Layer Scanning: Temporary fix for cache growth

One of the training samples' `LimeLayer` exhibits poor cache behavior -
only 14 hits in a complete scan, with read sizes of 16MB each, resulting
in an 8GB RSS. This is a temporary hack until we develop a more complete
understanding of how common this is, and how best to mitigate it.
This commit is contained in:
David McDonald
2025-05-14 15:46:23 -05:00
parent f3e123b4d5
commit b89b0c0c38
@@ -358,6 +358,10 @@ class DataLayerInterface(
for layer_name, address, chunk_size in data_to_scan:
try:
data += self.context.layers[layer_name].read(address, chunk_size)
try:
self.context.layers[layer_name].read.cache_clear()
except AttributeError:
pass
except exceptions.InvalidAddressException:
vollog.debug(
f"Invalid address in layer {layer_name} found scanning {self.name} at address {address:x}"