-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tvips memory usage on windows #15
Comments
Maybe you could look into dask-memusage to figure out where things are going wrong? See https://blog.dask.org/2021/03/11/dask_memory_usage |
Good idea! So I edited the example script to copy the compute commands above: from time import sleep
import numpy as np
from dask.bag import from_sequence
from dask import compute
from dask.distributed import Client, LocalCluster
from dask_memusage import install # <-- IMPORT
from hyperspy import api as hs
fname = r'file.tvips'
def get_center():
data = hs.load(fname, lazy=True)
center = data.data[:, 256, 256]
return center
def main():
cluster = LocalCluster(n_workers=1, threads_per_worker=1,
memory_limit=None)
install(cluster.scheduler, "memusage.csv") # <-- INSTALL
client = Client(cluster)
compute(get_center())
if __name__ == '__main__':
main() and got the output shown below. Quite difficult to interpret. The max memory usage never appears to go above 10 GB (file size is ~9.8 GB). Monitoring task manager at the same time showed that at least 24 GB were being used as a result of the script. Quite likely that I am not using the library properly in this case.
|
From @harripj in hyperspy/hyperspy#2781:
Just a follow up on this. On my Windows machine I seem to be experiencing the same behaviour as before:
If I load one of our experimental datasets (size 9.9 GB) as
data = hs.load('dset.tvips', lazy=True)
the file is not loaded to memory as expected. Withlazy=False
the peak memory usage is double the file size before settling back to ~file size:Using the lazy
loader
again, if I just extract the center pixel from each frame as:The whole file is loaded to memory and persists:
Interestingly the memory presists even if I call
del center; del data
.Dask version:
2022.03.0
NumPy version :
1.21.5
Hyperspy version:
1.7.0.dev0
, ie. local install of this PR.Originally posted by @harripj in hyperspy/hyperspy#2781 (comment)
The text was updated successfully, but these errors were encountered: