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

  • Home
  • SEARCH
  • 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 8319063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:11:51+00:00 2026-06-08T22:11:51+00:00

I am running some experiments using a Java program including Hibernate data storage. An

  • 0

I am running some experiments using a Java program including Hibernate data storage. An Experiment can contain many Trials, and each Trial can have many Tests. Each Experiment is conducted in a single Spring transaction.

When there are small amount of Tests, everything is fine, but as data volumes increase I start to encounter Java heap space out of memory issues. The memory issues seem reasonable given the amount of data I am processing in a single transaction.

My current workaround for this is to:

Set up and save the initial Experiment
Run a set of Tests.
Summarise the Test results and create a Trial record
Delete the Test records
Save the completed Trial
Prompt the Garbage Collector to run

This works, and I can conduct extensive experiments using the framework. However, I no longer have access to perform data analysis on the detailed Test records, as I had to delete them to prevent memory issues.

What I would like to do is save the Test records to file, and then “unload” them from the heap. The Trial will still have a one-many with the saved Test records, but since the Tests are completed, I no longer need the details in memory.

Set up and save the initial Experiment
Run a set of Tests.
Summarise the Test results and create a Trial record
Save the Trial (with cascade saves for all Test records)
Unload the complete Test records 
Prompt the Garbage Collector to run

Can anyone think of a resolution for my problem ?

  • 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-08T22:11:53+00:00Added an answer on June 8, 2026 at 10:11 pm

    To prevent your objects to be be in the Hibernate Session (and be able to be garbage collected), you should simply detach your objects from Hibernates session (using session.evict()). In your case you should iterate through all Test instances after each save of a Trial, evict them, and then evict your Trial as well.

    When you need your object again you can load your objects again using normal Hibernate methods (load or queries). You should probably consider lazy-loading on Trial.test if they are not needed.

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

Sidebar

Related Questions

When running some tests I came across the following issue. When using: private String
I am running some java script with a couple html controls. Everything works fine.
i've been running some experiments of my own with Spring Roo and it seems
I am running some experiments, timing them and comparing the times to find the
I have a Python program that runs a series of experiments, with no data
I am running some experiments with I/O intensive applications and am trying to understand
I am learning Java and am trying to do some experiments with networking Java
I'm running some experiments in WebGL, one of them being an XOR effect fragment
I am running some C code, compiled to 32bit x86 on Linux. And I
So I'm running some animations to bring in some divs in my first jQuery

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.