Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8072391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:00:19+00:00 2026-06-05T14:00:19+00:00

I have several background tasks running on my Glassfish server implemented by @TimerService instances.

  • 0

I have several background tasks running on my Glassfish server implemented by @TimerService instances. The goal of these services is to extract data from files and insert that data into the database.

I tried initially to do this in JPA but the system stalled far to easily, I have now converted the process to JDBC which is far more responsive. However there are still enormous memory leaks somewhere along the way which I cannot pinpoint.

Each file is extracted in a method which manages its own transactions (1 file = 1 transaction). I would think that once this method finalises all variables loose scope and be GC’ed, but this is not the case. After a very short time I am experiencing OutOfMemoryException.

I am wondering if, how, and why Glassfish would be keeping reference to my variables (which are very heavy objects). What settings or methodologies can I apply to minimize these memory leaks?

For reference I am using the stock Glassfish settings with a couple of modifications :

-XX:+CMSPermGenSweepingEnabled 
-XX:+CMSClassUnloadingEnabled 
-XX:MaxPermSize=256m
–XmX1024m
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:00:22+00:00Added an answer on June 5, 2026 at 2:00 pm

    You might be dealing with a class loader leak. JAXB can do this when you’re unmarshalling. To find out for sure you should use a memory analyzer. I highly recommend using the Eclipse Memory Analyzer Tool. Just follow a few of the tutorials and you should be able to get it figured out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I have several builds running on a Windows Server 2003 R2 machine via
Some background info: We have several websites running on a 64-bit machine with IIS6
I have 2 1024x1024 sprite sheets, one containing several 480x320 background images and another
Background: I have a ListView / GridView with several columns. In some situations, only
I have several xml files with different node structure. I want to extract xml
I'm working on a project that interfaces with Google Data APIs. I have several
I have to call several (> 10) .exe command line programs in the background.
I have several pages with a background image applied to the body of each
So I have several buttons, and I want the background of an app screen
and thanks for taking a look at the question. The background I have several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.