I am running a 64-bit Ubuntu 12.04 on a machine with 8GB RAM. I wrote a C++ program that I compiled with the -m64 (force 64-bit executable) flag in gcc
. I checked that the resulting executable is indeed 64-bit.
However, the process caps at using 4GB RAM. How can I allow it to use more?
Edit: output of ulimit -a
ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 62900
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 62900
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Edit 2: link to output of dstat -cdgms --vm
https://www.dropbox.com/s/927s5x6v4bhp4qs/dstat_log.xlsx?dl=0
As best as I can tell, adding the -m64 compilation flag (force 64 bit executable) actually solved my initial problem (app crashing), and what followed was a coincidence that my app actually required so little memory over 4GB (limit for a 32-bit executable) that it showed up as 4GB flat in System Monitor. Thank you to all who contributed, there are a number of things in the comments that might help people trying to diagnose similar issues.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.