-
Notifications
You must be signed in to change notification settings - Fork 46
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
flexmap allocate huge amount of physical memory #501
Comments
Thanks for the report, which I confirm shows a real problem! There's a slight issue with your immediate fix, which makes the tests fail, which is revealed by changing the last line of your script to: say "done: size=$size mapflex.info=", $mapflex->info; which then prints:
A great technique for testing just one bit of the vast repo, that I use all the time including here, is:
|
Sorry for my bad fix, it has more problems than it solves. I assumed |
Your assumption was right (it's |
Wow. If you can make |
Sorry, are you saying that |
To try to be clear: I'm working towards a slightly different model for In the meantime, |
In fact, I've just realised why The issue arises because |
The above commit fixes this problem as far as your script seems to show, while still passing the tests. @vitstradal Please could you try it, and if you agree, could you close the issue? Please make sure you're happy that ndarrays can also write. |
Thank you very much @mohawk2, it working very nice. Thank you for quick fix very much. Sorry about the write/readonly note. I create wrong impression from one of my many experiments, and got confused. Every think is OK. |
That's quite alright! As you might tell from the various commits it took to fix this, and the obscure things that were involved in causing it, it was a complicated situation, so it's understandable to be confused - I was :-) |
PDL::IO::FlexRaw::flexmap
claims to work with mmap'ed file so can handle data bigger than physical memory. However, during initialization before assigning mmaped area, it creates emptyzeroes
piddle witch final dimensions, and it allocates (and then immediately deallocate) size of data. In code it is here.This is my naive fix: here.
Following reproducer takes parameter memory size in MiB, and tryes two dimensional piddle of such size. If you put there number bigger than your free physical memory, it will fail on
Out of memory
or by OOM killer and did not reachdone
message.The text was updated successfully, but these errors were encountered: