Win a copy of Modern frontends with htmx this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

memory not releasing

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a pretty complicated swing application that is eating up memory. We found some memory issues, but still have this remaining. We allocate 128mb of RAM to the heap. We see the garbage collector doing the work from 20 to 127mb because the the memory will go up and down. Once we hit the 128mb size, the memory never goes down and just stays there. The only way we can clear it out is to restart the swing application.

Any ideas? Thanks in advance!
 
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you using to determine the use of memory?

If you are using from the operating system it's expected that you will see the heap grow to 128 and stay there. The reason is that the gc will reclaim memory, but that memory is generally saved within the JVM and not returned to the system. If you are not having OutOfMemory errors and not having performance problems I wouldn't worry about it.

On the other hand if you are using some tool to see the heap usage of the JVM I would get a profiler and start looking for where the memory is going.
 
Eric Braun
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, we are wathinc the cpu system resources and we are experiencing OutOfMemory issues.

If we let them open too many jPanels (each one is taking a good chunk of memory), they get the OutOfMemory. If we limit them to a predefined amout of JPanels, then we eliminate the memory error.

Also, do you know if the inner classes used for the swing objects actually get destroyed when the class is destroyed? I am wondering if I create a class for each form that holds the inner classes and then manually destroy that class, if that will give up memory?
 
reply
    Bookmark Topic Watch Topic
  • New Topic