Hi Guys,

Is this right to say Heap is RAM and Stack is Pagefile(HardDrive)? Sorry for silly question. :?:

Recommended Answers

All 2 Replies

Is this right to say Heap is RAM and Stack is Pagefile(HardDrive)?

No. Both are RAM-based and both can be swapped into virtual memory if they exceed limits. However, the stack size is not dynamic, so it's less likely to dip into virtual memory than the heap. You can set a stack size at build time that exceeds available physical memory, but that has to be an explicit choice as the defaults are typically more reasonable to avoid thrashing simply by executing a process.

Thanks a lot for reply.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.