I am striving to maximize speed of my program (in order to get results in real-time) and avoid unnecessary loading of data from hard drive.
Program is supposed to process a huge amount of images and I would like to handle in RAM as much processed data as possible. But I found out that malloc
won't allocate more than 2GB even when I'm having 8GB of RAM (Windows 7 64-bit).
How can I make my program use as much RAM as possible?
I believe the windows equivalent of mmap(2)
is VirtualAlloc
This should allow you to use a lot more memory. Please keep in mind that the OS may still decide to page out your memory. You can lock it in RAM with VirtualLock
. The amount of lockable memory may be limited though.
Also as mentioned in the comments make sure to compile your program as 64-bit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With