top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Can a java application have memory leak?

+5 votes
343 views

My doubt is that doesn't Java virtual machine have a garbage collector that will collect and free all unreferenced memory automatically?

posted Jan 31, 2014 by Asmita Agrawal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

Considering that java uses a garbage collector to collect unused objects, you can't have a dangling pointer. However, you could keep an object in scope for longer than it needs to be, which could be considered a memory leak.

answer Jan 31, 2014 by Salil Agrawal
Similar Questions
+2 votes

Code is in C/C++ and some scripts in shell and PHP, any suggestion other then building inhouse tool.

+3 votes

I have few questions about Cache Memory

1) My understanding of cache memory is, there are 3 type of cache memory,
1. Within RAM
2. Within CPU (L1,L2,L3)
3. Separate Hardware which is costlier than all others.

Please correct if I am wrong,

2) Who stores the data into cache? I mean, can we write a program which should use only cache memory? If yes then how to do it? if no then who manages that?
For example,
Cache memory within RAM, is it managed by Kernel?(Memory Management Unit)
Cache memory within CPU, is it managed by CPU itself?

3) Why cache memory is faster than RAM?

...