64-bit program memory usage
Wed Jun 18 00:28:00 GMT 2003
I recently re-compiled my old C code to 64-bit on Solaris 8
using gcc 3.2.0 with -m64 switch. It turns out that the 64-bit version uses
twice as much memory as the 32-bit counterpart does. My program reads
large data files into memory so memory usage is big concern. With one
of my testcases, the 32-bit uses 2.1G while the 64-bit uses 4G memory.
I do use pointers intensively as I need to store them in binary
tree type of structure. Is that the reason why memory usage gets doubled
(since pointers are all 64bit now)? Any cure?
More information about the Gcc-help