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

huge image - memory management #22

Closed
zebastian opened this issue Jun 28, 2015 · 1 comment
Closed

huge image - memory management #22

zebastian opened this issue Jun 28, 2015 · 1 comment

Comments

@zebastian
Copy link
Collaborator

on really huge images (eg 10000 * 50000) the program is not capable of allocating memory in cImage::AllocMem.
But instead of throwing an badalloc error in any way, the program crashes.
It would be good to have a way of reading available memory, checking against GetUsedMB, and then throwing error / allocation. (could still fail, but better than nothing)
There is neither a builtin way for c++ to do that, nor for qt. So we would be forced to use some hackish platform dependent code like:
http://stackoverflow.com/questions/8122277/getting-memory-information-with-qt?answertab=votes#tab-top

Or we could try to use some other allocating method, to prevent the rest of the program to crash.
Opinions appreciated :)

@zebastian
Copy link
Collaborator Author

fixed with fb0a9fb
bad alloc is catchable, if memory gets freed directly and top level handles "not prepared cimage" accordingly

This was referenced Jan 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant