JpaContainer, memory leak

Hello,

I am a vaadin user. I am face to a memory leak issue when I am using jpacontainer.

Issue Description: used memory increased in an unexplained way when using jpacontainer add on.
I am using hibernate with jpacontainer. I have disabled hibernate cache machanism.
However ,after releasing object (set to null), memory doesn’t really decrease.
Also , after logout application + close application, memory doesn’t really decrease.

Was that related to jpacontainer cache mechanism? or exactely what?

In my application , I am using a lot of object type jpacontainer.
To instance a jpacontainer object , I am using this code :
JPAContainer jpa = JPAContainerFactory.make(MYClass.class, “my_persistence_unit”);

I am not using explicit manager entity. I am using JPAContainerFactory directly. That is what I found in jpacontainer’s tutorial.
I don’t know if this call was a bad choice.

If it is the case , can you tell me please how can I instanciate jpacontainer object
in a big application using a huge number of jpacontainer’s objects,
How can I do that in a good way in order to avoid unexplained increasing used memory and memory leak.

For more informations,

I am using

  1. Apache tomcat as server

  2. persistence.xml file to configurate my persistance unit + hibernate.

  3. I am using a treetable , tabsheet , accordion components.

  4. To change user interface , most of the time I am using the method removeAllcomponent from the window.

I am not sure if used jpacontainer with old components can or not be garbage collected.

=> can this method “removeAllcomponent” causes memory leak?

I am waiting for answer.

Thanks in advance

Hi,

I think you’re using JPAContainer in the right way, if I understood you correctly.

Could you please run your application in a profiler to identify what is leaked and possibly where? If you’re not familiar with any java profilers, try VisualVM, which is bundled with Oracle’s JDK. Google “visualvm” for instructions on how to use it.

If you confirm that the leak is in JPAContainer, please file a ticket for it at
dev.vaadin.com
and mark the component as “JPAContainer add-on”.

If you have a
pro account
, you can mark the ticket you created for bugfix priority or you can contact our support team and have them investigate the issue.

Thanks,
/Jonatan