Out of Memory
-
windows stop allocating memory to my app after 1.7G memory usage. i have allocated some page file. but it seemed to not working because i have some logs that indicates appliucation is out of memory:
QImage :: out of memory return null
QPainter :: can not start ...
QThread :: start() :: can not start
and after these whenever a signal emits application crashs!
what can i do before i optimize my memory usage that i decrease this crashes? -
Hi
Is it a 32 bit app ?
What platform are you running it on ? also 32 bit ?
There is hard limit of 32 bit of around 2GB and you might be hitting that. -
@mahd96
Hi
On the windows platform, please see here
https://docs.microsoft.com/en-us/windows/desktop/Memory/4-gigabyte-tuning
So your app has around 2 GB to use.
https://docs.microsoft.com/en-us/windows/desktop/Memory/memory-limits-for-windows-releases#physical-memory-limits-windows-10
So most likely at 1.7 GB, you try to allocate a QImage that want to use way more memory (than 300 MB) and it fails. -
@mahd96 said in Out of Memory:
what can i do before i optimize my memory usage that i decrease this crashes?
You can create a 64-bit app. That allows your app to use more than 2GB without changing Windows settings.