Memory leaks, in the classic sense, don't (shouldn't, rather) occur in Java, since you have no direct way to allocate and (forget to) deallocate memory. There are ways (as always) you can get close though, see Dobb's. To understand stacks, insofar as they apply to Java, refer to Chapter 3 of the VM Specificaion. You may also want to pick up a good general science book on compilers or spend some time with a good C/++ book. At the end of the day, it's all the same, just different faces.

well for memory leakage u must have got the answer. as far as stacks are concerned I'll tell u. Stacks are data structures i.e. they have ability 2 store data. They r typical in the sense that u can only add data to the top of the pile. Say it's like a pile of bricks in which u can only remove or add bricks from the top. u can't operate on it in somewhere middle or bottom but u r allowed operations only on the top of the stack. this is also termed as tos(stands for top of the stack). 2 terms typical to it r push & pop. push is adding element 2 the top of the list & pop is removing element from the top of the stack. in java we've the implementation of stack as a class & is available in collections framework. hope I made my point clear. all the best

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428

posted Aug 06, 2001 17:15:00

0

I got it now. Thanks to all. Angela

Originally posted by jatin rai:well for memory leakage u must have got the answer. as far as stacks are concerned I'll tell u. Stacks are data structures i.e. they have ability 2 store data. They r typical in the sense that u can only add data to the top of the pile. Say it's like a pile of bricks in which u can only remove or add bricks from the top. u can't operate on it in somewhere middle or bottom but u r allowed operations only on the top of the stack. this is also termed as tos(stands for top of the stack). 2 terms typical to it r push & pop. push is adding element 2 the top of the list & pop is removing element from the top of the stack. in java we've the implementation of stack as a class & is available in collections framework. hope I made my point clear. all the best

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428

posted Aug 08, 2001 15:36:00

0

I read the link site. I still don't understand the difference between role of stack and heap in JVM Please do let me know, Thanks Angela

If I recall correctly, the stack is used to keep track of stuff between function calls (every new function call has its parameters pushed on to the stack and popped off by the called function). The heap however is what is used to allocate new memory for data structures. I hope this helps and is correct.

God help us if computers ever unite against us<BR>When computers get together to make decisions, they form a Beowulf cluster. When humans get together to make decisions, they form a comittee. Need I say more?<P>-- archnerd on slashdot