I have a very memory-intensive C# desktop application and my question is: Is increasing the RAM of the computer better (for a single application), or it’s just better for supporting many applications at the same time?
My operating system is Windows 7 (64 bit).
To explain more, what I know is that the memory available to a process is the stack (per thread) and the heap. The stack is independent of the computer’s RAM and generally it’s the operating system that determines its size. But the heap is much larger and it’s recommended that large objects are to be placed on the heap (that’s what new in C# does, it takes memory from the heap).
So the question again is: Does expanding the RAM of a computer expand the heap available to each process? And is there a heap for each process, or it’s just a single heap?
Firstly, I think it’ll be really helpful if you dived a little into operating system concepts such as “process address space” and how processes and virtual memory work at the basic level.
This seems good -> [1]: http://duartes.org/gustavo/blog/post/anatomy-of-a-program-in-memory
Each process has its own process address space and thereby its own heap. The heap is a part of the “virtual address space” that caters to dynamic memory allocation. It also depends
on the range of addressable memory your OS can accommodate. For instance, in a 32 bit system the maximum addressable range can never exceed 4GB.
Adding more RAM can make some difference (not a night and day one though) by reducing things like thrashing.