Quantcast

Potential memory leak when using Service in Quartz job

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Potential memory leak when using Service in Quartz job

pjagielski
This post has NOT been accepted by the mailing list yet.
Hi all,

I've encountered a memory leak problem in my application. After analyzing heap dump it occured that Quartz Job holds reference to Hibernate session which was full of objects loaded in my service.

Here's the code from my job:

    NewsService newsService

    def execute() {
        try {
            newsService.importNews()
        } catch (Exception ex) {
            log.error("Error importing news", ex)
        }
    }

The importNews() method is iterating one of my domain class with .all method.

The problem dissappered after setting  sessionRequired to false (and concurrent to false too) in my job.

Am I missing something?

Regards,
Piotr Jagielski


Loading...