Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: How does Java manage memory? I got curious after seeing a live profiling session

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How does Java manage memory? I got curious after seeing a live profiling session

    So I just found out NetBeans has a great live profiling tool so I can manage all my memory-usage and such.
    What I noticed was my virtual memory going up slowly as I increased the connections to the server, but after a while (after closing the connections) it got to a critical point where the memory sort of 'resets'.. Can someone explain to me whats happening? Is this the garbage collector doing it's thing?


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: How does Java manage memory? I got curious after seeing a live profiling session

    Likely, yes. As you open more and more connections, your Java app requires more memory to maintain each connection. However, once the connection is closed the JVM won't immediately reclaim the memory. Instead, every now and then it will call the garbage collector and that will go around looking for unused memory and reclaim it. It's possible to manually force the garbage collector to start, though it's generally not advisable.

  3. #3
    Junior Member
    Join Date
    Dec 2010
    Posts
    3
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: How does Java manage memory? I got curious after seeing a live profiling session

    the graph of the memory in the JVM is like of SAW TOOTH (this is in Ideal case). when the memory is about the completely filled by the objects then the JVM invokes the Garbage Collector to remove the Unreferenced objects and frees the memory so that there is memory for the new objects to be created.

Similar Threads

  1. live feeds and jtables
    By petem86 in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: September 19th, 2010, 08:44 PM
  2. Memory Handling -de allocate memory in Java
    By 19world in forum Java Theory & Questions
    Replies: 4
    Last Post: June 15th, 2010, 04:05 AM
  3. Out of memory work around for a java application (please help!)
    By javameanslife in forum Java Theory & Questions
    Replies: 5
    Last Post: January 22nd, 2010, 03:27 AM
  4. Java memory management
    By trueacumen in forum Java Theory & Questions
    Replies: 5
    Last Post: August 12th, 2009, 02:40 AM
  5. Java session problem
    By Padmaja in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: August 5th, 2009, 09:06 PM