Skip to content
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

Memory issues for chunks in global-files #12

Closed
valpesendorfer opened this issue May 4, 2018 · 2 comments
Closed

Memory issues for chunks in global-files #12

valpesendorfer opened this issue May 4, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@valpesendorfer
Copy link
Member

Traceback:

Error message:

Traceback (most recent call last):
  File "C:\Python27\ArcGIS10.4\Lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\ArcGIS10.4\Lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "T:\VALENTIN\py27\wsmtk\Scripts\processMODIS.exe\__main__.py", line 9, in <module>
  File "t:\valentin\py27\wsmtk\lib\site-packages\wsmtk\processMODIS.py", line 82, in main
    h5.update()
  File "t:\valentin\py27\wsmtk\lib\site-packages\wsmtk\modis.py", line 263, in update
    dset[blk[0]:(blk[0]+self.chunks[0]),:,uix:(uix+arr.shape[2])] = arr[...]
  File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "t:\valentin\py27\wsmtk\lib\site-packages\h5py\_hl\dataset.py", line 632, in __setitem__
    self.id.write(mspace, fspace, val, mtype, dxpl=self._dxpl)
  File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py\h5d.pyx", line 221, in h5py.h5d.DatasetID.write
  File "h5py\_proxy.pyx", line 132, in h5py._proxy.dset_rw
  File "h5py\_proxy.pyx", line 93, in h5py._proxy.H5PY_H5Dwrite
IOError: Can't prepare for writing data (memory allocation failed for raw data chunk)
@valpesendorfer valpesendorfer added the bug Something isn't working label May 4, 2018
@valpesendorfer
Copy link
Member Author

Couldn't be replicated ...

Might be due to corrupt files, PR #14 implements enhanced handling of corrupt files ... might be resolving the issue.

@valpesendorfer
Copy link
Member Author

valpesendorfer commented May 4, 2018

Turns out error is due to numpy running out of memory addresses using a PYTHON 32bit interpreter (even though there's plenty of empty RAM available)

See for reference: numpy/numpy#9960

PR #15 addresses this issue:

  • deletion of np array for block after writing to h5 file seems to mitigate the problem (working for now, but might reapear - maybe depending on what else is in RAM)
  • Adding a try-except section to catch memory issues and notify user

Maybe it should be added to the package description that it's to be run preferably with a PY 64 version.

valpesendorfer added a commit that referenced this issue May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant