• 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Free memory: Total memory: Max memory:

 
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I noticed that (in Tomcat manager) the free memory is around 400 but Total memory is increasing steadily. For example a few hours ago I saw:

Free memory: 392 MB Total memory: 835 MB Max memory: 1186 MB

And now it is:

Free memory: 390 MB Total memory: 959 MB Max memory: 1186 MB

Why is this?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why? - It is just the normal operation of a Java program. Since a server gets an unpredictable sequences of requests, a single moment when multiple request Threads need lots of memory to work will cause the JVM to request more memory, thus causing "total" memory to jump.

Now - if your code does not properly free up objects that are no longer needed you MAY be looking at a "memory leak" but detecting that will take more work.

Bill
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks William (Your book helped me pass exam!).

Now the Tomcat status is:


Free memory: 145.72 MB Total memory: 1186.68 MB Max memory: 1186.68 MB



It has been like this for a few hours but I have not got 'out of memory' error yet. I thought when Total memory reached Max memory I would get this error. Maybe I will get this error when Free memory goes to zero.

Thanks.
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having total memory equal max memory simply means that the last JVM request reached the limit. When trying to meet a new memory request that cant be satisfied with existing memory, the JVM always requests a good sized chunk because requesting memory from the operating system is time consuming.

Glad the book was helpful
Bill
reply
    Bookmark Topic Watch Topic
  • New Topic