This is really a broad topic to be covered in a short note. even in java. But I guess normally it's matter to developer only when you need decide memory setting and cope with GC. All java objects live in heap, so be prudent when setting the -Xmx and -Xms for heapsize; GC will work with the objects in the heap. Stack is mainly used by local variables and threads, it rarely a matter to me during system turning.