You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ilya Obshadko <il...@gmail.com> on 2015/11/01 15:57:51 UTC

HibernateSessionManager and background threads

I have recently noticed in my GC logs that application leaks memory after
running periodic background process which performs database operations. I'm
suspicious of Hibernate not cleaning up after himself. So the question is:
are there any specific techniques for using Hibernate in background
processes (i.e. via PeriodicExecutor)?

Any suggestions appreciated.

-- 
Ilya Obshadko

Re: HibernateSessionManager and background threads

Posted by Ilya Obshadko <il...@gmail.com>.
Thanks a lot, that seemed to finally help - instance is now running for 5
days without OOM.

On Sun, Nov 1, 2015 at 8:16 PM, Lance Java <la...@googlemail.com>
wrote:

> You'll need to @Inject the PerThreadManager and call cleanupThread() in the
> finally block of the task(s).
> On 1 Nov 2015 14:58, "Ilya Obshadko" <il...@gmail.com> wrote:
>
> > I have recently noticed in my GC logs that application leaks memory after
> > running periodic background process which performs database operations.
> I'm
> > suspicious of Hibernate not cleaning up after himself. So the question
> is:
> > are there any specific techniques for using Hibernate in background
> > processes (i.e. via PeriodicExecutor)?
> >
> > Any suggestions appreciated.
> >
> > --
> > Ilya Obshadko
> >
>



-- 
Ilya Obshadko

Re: HibernateSessionManager and background threads

Posted by Lance Java <la...@googlemail.com>.
You'll need to @Inject the PerThreadManager and call cleanupThread() in the
finally block of the task(s).
On 1 Nov 2015 14:58, "Ilya Obshadko" <il...@gmail.com> wrote:

> I have recently noticed in my GC logs that application leaks memory after
> running periodic background process which performs database operations. I'm
> suspicious of Hibernate not cleaning up after himself. So the question is:
> are there any specific techniques for using Hibernate in background
> processes (i.e. via PeriodicExecutor)?
>
> Any suggestions appreciated.
>
> --
> Ilya Obshadko
>