Reputation: 1097
Say I have two process p1,p2 runnning as a part of my application.
Say p1 is running initially executing function f1() and then f1() calls f2().With the invocation of f2() process p2 starts excuting
What I want to confirm is it that :- 1)Do we have seperate stack for different process?
2)Do we have seperate heap for different process? or do different process share same heap?
3)As we know that for a 32 bit OS do for every process the size of virtual memory is 4GB .So is it that for every process which has 4GB as virtual memory this 4GB is partitioned into heap,stack,text,data
Thanks.
Upvotes: 7
Views: 7099
Reputation: 2373
There are other limitations to consider in Java too, such as only being able to address arrays using Integer.MAX_VALUE at most. This limits you to about 2GB in a lot of areas relating to memory.
Upvotes: 1
Reputation: 11284
1) Yes, each process gets its own stack.
2) Yes, each process gets its own heap.
3) I don't think you get the whole 4GB. Some of it is reserved for kernel stuff.
Upvotes: 10
Reputation: 35450
Upvotes: 3