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 6476931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:53:10+00:00 2026-05-25T06:53:10+00:00

I have an application that performs a very sequential set of discrete tasks. My

  • 0

I have an application that performs a very sequential set of discrete tasks.

My problem is that one of the first tasks consumes a large amount of memory, and despite eliminating object references and invoking the garbage collector, only about half the memory is essentially freed. This impacts later tasks. The problem is also that I want to temporarily grant the JVM a large heap to efficiently manage the first task but I don’t want this to stick around till the GC decides it’s efficient to free the rest.

I had the idea of executing the memory-intensive task inside thread; the new child thread uses the parent JVM (no surprise here), but there appears to be no change in the memory management.

How does Java handle Thread memory? Is there a simple way to create a child heap for the subthread that can be dumped after the thread has finished?

As an addendum, here’s what I actually want to do:

  1. Setup a Neo4j graph database (I’m creating several million nodes, properties and relationships, along with numerous indexes) [memory intensive]
  2. Perform queries on the graph database
  • 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-05-25T06:53:10+00:00Added an answer on May 25, 2026 at 6:53 am

    No, heap is shared between threads and there isn’t a way to reserve memory for a given thread or allow a thread to break limits. Threads are not processes (despite they are implemented this way in some jvm).

    You could run this thread in a separate procss (different JVM) and pass data to it via files or sockets, but while it would solve memory problems, it could kill performances … but depends on how much data you need to pass.

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

Sidebar

Related Questions

We have an application that performs comparisons on data objects to determine if one
We have a desktop application that performs a pretty rigorous set of calculations in
I have a MDI WinForms application that can perform several tasks. Each task is
I have a very simple Java application which downloads a set of foreign exchanges
I have an application that performs a write to a database each time a
Our application has a very large, wide table of transactional data. We have a
I have a small application that process a large quantity of (relatively small) files.
I am building a very simple asp.net application that will have a SQL Server
I have an application that uses DataTables to perform grouping, filtering and aggregation of
I have a web application that uses two databases. DB1 Users perform their CRUD

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.