Allocating more than 1,000 MB of memory in 32-bit .NET process

前端 未结 6 1819
眼角桃花
眼角桃花 2020-12-01 08:10

I am wondering why I\'m not able to allocate more that 1,000 MB of memory in my 32-bit .NET process. The following mini application throws an OutOfMemoryException after havi

6条回答
  •  醉酒成梦
    2020-12-01 08:51

    I think the issue here is that this application will be adding 10MB with every loop it makes, and the loop is: "while(true)" which means it will adding these 10MBs till the application is stopped. So if it were to run for 100 loop it would have added close to 1GBs to RAM, and I'm assuming that it would have done this in less than 30 seconds. My point is you are trying to 10 megabyte's of memory per loop, in a never ending loop

提交回复
热议问题