• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Session timeout and memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Session timeout and memory


  • Subject: Re: Session timeout and memory
  • From: Ute Hoffmann <email@hidden>
  • Date: Tue, 12 Sep 2006 08:18:38 +0200

Ok, perhaps I'm looking at the wrong thing. This is the piece of code which I use to determine the used memory:

Runtime runtime = Runtime.getRuntime();
double nochVoranden = new Double(runtime.totalMemory () - runtime.freeMemory ()).doubleValue();

So this happens to the logs:
The memory goes up inside of the session. It sometimes drops a bit but it mainly goes up. So there seems to be a memory leak somewhere...

Ok, but then the session is terminated or times out. So I would assume that then the memory is returned as free memory.
So the next session should again show used memory lets say 6 MB.

But when the previous session had a used memory of lets say 50 MB the next session (created well after the first session is timed out or terminated) will show 50MB + of used memory.

And yes: There was only one session present in the testcase and it clearly went up after the first session was timed out without releasing this used memory.

Do I have to schedule the instances to get rid of this (as it happens by design) or does it point me to a memory leak in my code which means whatever holds the memory cannot be released even after the session is terminated.

Regards

Ute

Anfang der weitergeleiteten E-Mail:

Von: Q <email@hidden>
Datum: Di, 12. Sep 2006 01:43:35 Europe/Berlin
An: Chuck Hill <email@hidden>
Cc: Ute Hoffmann <email@hidden>, email@hidden
Betreff: Re: Session timeout and memory


On 12/09/2006, at 2:26 AM, Chuck Hill wrote:

In addition to garbage collection which has been mentioned, be careful of what you are looking at. If additional memory is allocated to the JVM process, it will not be returned to the operating system until the JVM process terminates. In other words, the total heap size will never decrease but free memory on the heap will vary as objects are created and the garbage collector runs.

Chuck

It should also be pointed out that this is a good thing not a liability that needs special consideration, because it means that the JVM doesn't need to constantly malloc and free memory. Provided there isn't an actual leak causing the JVM size to continually grow unexpectedly, the virtual memory allocation shouldn't be something to really worry about, as any vm pages that go unused for long enough will eventually get paged out by the OS should the physical memory be required for something else. Assuming your OS has got enough swap allocated.

--
Seeya...Q

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

_____ / Quinton Dolan - email@hidden
__ __/ / / __/ / /
/ __ / _/ / / Gold Coast, QLD, Australia
__/ __/ __/ ____/ / - / Ph: +61 419 729 806
_______ /
_\



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Session timeout and memory
      • From: Alexander Spohr <email@hidden>
    • Re: Session timeout and memory
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Moving Classes into a package
  • Next by Date: Re: Moving Classes into a package
  • Previous by thread: Re: Session timeout and memory
  • Next by thread: Re: Session timeout and memory
  • Index(es):
    • Date
    • Thread