Those negative numbers come from values that were too big for signed positive numbers in 32 bits. The -1510MB really means approximately 2.5GB. Allowing for fragmentation and for code and other memory areas not counted in that total, it probably means 3 GB.
The amount of physical RAM you have (4 GB) is not all that closely related to the amount of virtual memory a process can use. You are almost certainly hitting the limit of the amount of virtual memory that process can use.
I assume you are running with a 32 bit kernel (the output of uname -a would confirm or correct that assumption).
To use more virtual memory per process, you would need to switch to a 64 bit kernel. A 32 bit executable can use a full 4 GB of virtual memory when run under a 64 bit kernel (it is limited to 3 GB when run under a 32 bit kernel).
If that increase from 3 GB to 4 GB isn't enough to run that task, do you have source code to that program, so you could recompile the program as 64 bit?
A 64 bit program (which requires a 64 bit kernel) can use almost unlimited virtual memory. The physical RAM of 4 GB does not limit that as long as you have enough swap space. But there is a serious chance that a program that fails to fit in 4 GB when compiled for 32 bit would run too slowly to be useful when compiled for 64 bit and run with 4 GB physical and lots of swap.
|