c++ - why malloc always failed allocate memory (roughtly 9GB but I have 16GB physical memory)? -


i believe have enough memory (16g) allocation in ubuntu (64 bit application). still return null.

following memory information running free command.

             total       used       free     shared    buffers     cached mem:      16376100    3295024   13081076      41936      88852    1073808 -/+ buffers/cache:    2132364   14243736 swap:     15998972          0   15998972 

screenshot:

http://i.stack.imgur.com/qjw27.png

based on comment, figured out. that's because when calculate memory size, sum overflowed.

another case use int n_dataset = 2453688725; overflowed, n_dataset negative number.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -