Lunarpages Web Hosting Forum

Author Topic: Memory Problems  (Read 1443 times)

Offline odin60

  • Newbie
  • *
  • Posts: 2
Memory Problems
« on: December 08, 2005, 09:21:41 AM »
Hello,

For months we have been having troubles with Resin increasingly needed more and more RAM. Originally Lunarpages thought it was an endless loop or recursive method but recently we noticed something.

We recently got a new server and are setting it up so we also decided to run some tests to determine our problem.  What we have found is once someone logs into our site we see a jump in Memory Usage for all Resin threads. When they log in we store various objects in their session to save time retrieving the same information from the database constantly so I would expect to see this jump in RAM.

What I really don't get is why after a user logs out and the session is invalidated or the sessions times out, why do we never get this RAM back? The % of RAM used stays at the same level and a new session only increases this future "minimum" level of RAM until our site crawls and we have to restart.  So here is the big question, why is this happening? Is it a problem with garbage collection? Memory Leaks? Resin itself? Configuration problems? Not enough RAM?

Since this increase only seems to happen when a new session is created I cannot see it being anything else and hope this problem has finally been found and now it just has to be fixed. Any suggestions/solutions to why this would be happening would be appreciated!

Offline perestrelka

  • Master Jedi
  • *****
  • Posts: 1397
Re: Memory Problems
« Reply #1 on: December 08, 2005, 02:37:49 PM »
Hi,

Sometimes, such issue occurs if class inherited from an abstract class stores data in sessions and an array is created in the abstract class.

Do you face such issue in your local development environment? Does this happens if you use another servlet container (for example, tomcat or resin 3).

There are memory tunning and troubleshooting tips at caucho's site:

http://www.caucho.com/resin-3.0/troubleshoot/technique.xtp#thread-dump

However, I'm not sure if they work for Resin 2.1.

Kind Regards,
Vlad Artamonov