• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

handling Memory leakage

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I read in java memory leakage happens .So can any one tell me how to handle memory leak in java .

I know we cannot force garbage collector ,but still, is there any way to handle memory leake by knowing JVM architecture.I mean by getting control over JVM (from java application) ,can i handle memory leakage?

Can any one please let me know the ways used by real-world applications to overcome memory lekage problem.
[ May 03, 2007: Message edited by: harish thrivile ]
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to learn about how GC works and how to tune it, this article will give you some insight.
That will tell you how to tune your JVM according to the kind of objects created by your application. However, the basic idea is to remove all references to a created object as soon as you are done with it. The GC (if tuned properly) will take care of the rest.
Also, this article tells about different kind of references available with java. Probably, that will help you too.
[ May 03, 2007: Message edited by: Nitesh Kant ]
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Memory can be leaked in two cases: a bug in the JVM, or a bug in the application code. In the former case, you should file a bug report with Sun, in the latter case, fix the bug in the code.

You don't need to force the JVM to run the GC; it will do so automatically if it needs to.
 
Your mother was a hamster and your father was a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic