Memory increasing in my vaadin application

Hi all,

   I have been using vaadin for our project since 1 year. It is amazing frame work i have seen before. In my vaadin application we have list of tree menus ,for each tree menus we have a seperate form will be load. The problem is that , while clicking on each tree menu  approximately 1 MB memory increasing in my system. This continuous and occupy full memory and swap memory in one situation and hang overing. 
  I have closed the all database statements and i have properly handled the variables ,new object creation [ meant , whenever not necessary disposing the variables and objects]


  Still i have this memory problem . Please give me some suggestions to recover from this problems.

My system configuration

 Memory              1.7GB

 Processor           AMD 

 Swap memory    2.8GB

           Thank you

You could make a memory dump and analyse which objects/classes are getting large and are not carbage collected

Use a tool such as JProfile (commercial) or Visual VM to try to figure out where exactly your memory leak is. If you have some Vaadin component that consumes a lot of memory (for example, a select which uses a large container), you could try releasing the memory by overriding the detach() method of the Vaadin component. The detach() method is called when the component is removed from a component container.

I used the detach() method in 4 forms . But still memory increasing .Where can i use detach() in my apps exactly?. Where i get a simple program for this detach() method?.

please give me the list of components which takes lot of memory like Select as you said .

         Thank you

Like I mentioned, detach is called when a component is removed from a component container. What do you do inside the detach method? What you could do, for example, is to remove container references to large containers, so that they will be garbage collected (and thus releases memory).

Unfortunately there is no list of components that take a lot of memory, that is application specific, so that’s something you need to find out yourself using a profiler.

I used the visualvm .It shows byte and char
creating more instances . It is realated to vaadin components.

Thank you.


I have the same issue, it’s really difficult to discover where this byte, char
, object are instantiated to be able to release it;

I used VisualVM to profile and the problem remains.


Apologies if this just confuses the issue, but have you run the test for a long time (e.g., long enough to run out of memory)? A while back I was doing some testing with an issue known to cause memory leaks in Java web apps (not Vaadin related), and thought I was seeing a memory leak in cases that shouldn’t have produced the problem.

When I reran the tests for a longer time, I saw that GlassFish, the Java EE RI, didn’t do a full garbage collection right away. So in the “good” cases memory grew and grew, but after X minutes dropped to where I expected it to be. In the case where I was causing a known leak, of course, it didn’t drop.

All of which is to say that a container doesn’t have to reclaim memory as soon as possible. It just has to
, and so wanted to ask in case that affects your testing.


Hi sir ,

      Yes sir , i had run my application  for an hour. The RAM Memory were going to 90%.My application ran very  slowly.Laterly i found  that one thread was started again and again .It  might  caused  this issue. Now i am  in safer side.I am using tomcat container and i used the glassfish also.

Thank you sir.


I use tomcat6 and even with no application activity the memory keeps to grow. I run the test for more than 1 day.

If I force the full GC than some memory is released. But I cannot run Full GC explicitly from the application because the application performance decrease because I have more concurrent users .

Best regards

Hi ,

     You have to detach the big container like TABLE,SELECT and so on ,if it is used in the thread loops. 
     You need to use profiler like VISUALVM which i was used to find out memory leak in my vaadin application. It is easy to use.
     If you use many forms then you can check memory leak by checking the each form seperately and find out which form takes more memory  and doesn't 
     release memory. This is the way i followed in my app.
     This is not a vaadin problem at all.