Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Java Memory Leaks  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have a huge program that after 4 hours or so of executing, crashes because of an 'out of memory' error.
I have downloaded jprobe and optimizeit, but do not know how to fully utilize the information from these windows. Anybody else use these programs before?
Anybody have any suggestions on how to fix a memory leak?
Thanks
 
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For OptimizeIt
1) Run the program in OptimizeIt
2) Shortly after it's in a stable state (i.e. after startup finishes), mark the memory
3) Come back a few hours later and see the difference in memory from the mark. This should give you an indication of what object in particular are being built up.
From there you can track, either on your own or using OptimizeIt where exactly those objects get created.
--Mark
 
C Munro
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, the object with the biggest difference was java.lang.ref.finalizer.
Are you familiar with this?
 
C Munro
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
actually I did that and the object with the most memory was the
java.lang.ref.finalizer
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Theoretical information, since I do not have access to profiling information.
1) Adding a finalizer method extends the life of the object, since it cannot be collected until the finalize() method is run.
2) finalize thread runs on lower priority than garbage collector. also there is no guarantee when it will run.
3) And the one common problem that occurs is that objects can be ressurected by another referrer even after being put on the finalizer queue.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!