c++ - Memory allocation - How 15 GB can be equal to 2GB? -


a major application of mine, crashing @ run time.

i want find out if related memory allocation issue system. thus, created small test program allocate 1gb of memory , simultaneously ran 15 such processes, using 15gb of ram in total.

however, when run program task manager shows has occupied 2gb of ram? how possible?

i wrote sample code follows

char *ptr[1024]; ( = 0 ; < 1024 ; ++i ) {     ptr[i] = new char[1024 * 1024];     std::cout << " allocated 1024 mb" << << " th time " << std::endl; } 

try storing data in big arrays. memset fine. looking @ actual memory if don't touch these still in virtual memroy.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -