The new operator throws an exception while there is a large amount of physical memory

In my program, I use the new operator to allocate about 130 megabytes and an exception, but I found that more than 800 megabytes are available in the task manager. I hope to find out the relationship between the physical memory specified in the task manager and the memory that my program can use.

Another reason is memory fragmentation. When I request memory allocation, memory is required as continuous. Is there a way to find out if such continuous memory exists?

+3
source share
2 answers

Physical memory <> Virtual memory.

32- , 2 ( 32- ). 32 , 2 . ( , 128 ?), , 2 ( ).

2 130 , 130 . Windows Vista, DLL (: ASLR), ( ), , .

:

  • , , ASLR . , . .
  • 32- 64- , /LARGEADDRESSAWARE (. editbin). 4 2 . , , "" (, ).
  • . , (, ).

, .

+4

, Windows. , . , 130 . , . , , , .

0

All Articles