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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:56:25+00:00 2026-06-13T22:56:25+00:00

I have an application that executes some heavy processing in background using java thread

  • 0

I have an application that executes some heavy processing in background using java thread pools.

Thread pool are configured to log exceptions occurred during the execution

public enum ExceptionLogger implements Thread.UncaughtExceptionHandler {
    INSTANCE;

    private static final Logger log = LoggerFactory.getLogger(ExceptionLogger.class);

    @Override
    public void uncaughtException(Thread t, Throwable e) {
        log.error("Exception occurred at thread " + t.getName() + "\n", e);
    }
  }

In the logs of my application I’m randomly getting java.lang.OutOfMemoryError: Java heap space but if I log memory usage using Runtime.getRuntime().freeMemory() I can see plenty of free heap space available.

In addition application continues working after I get this exception.

Is there any other reason for getting OutOfMemoryError with this message?

  • 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-13T22:56:26+00:00Added an answer on June 13, 2026 at 10:56 pm

    You will get an OutOfMemoryError when memory fails to allocate.

    This can happen when

    • you have run out of memory.
    • your GC turning parameters prevent it from using all the memory. e.g. setting minimum sizes for generations which are not full.
    • you allocate a large block of memory. Immediately after this fails you still have free memory, just not enough to allocate the large block.
    • you get an OutOfMemoryError which is not for the heap, e.g. PermGen or direct memory or virtual memory (for threads etc)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a load-testing application in Java, and have a thread pool that executes
I have a ruby application that executes ant as a subprocess using backtick. This
I have a C++ application that executes test cases. It is possible that some
I have an ASP web application that executes MDX queries using SSAS. I have
I have a small shell application that embeds Tcl to execute some set of
I execute some tests within my application, but before doing that I have to
I have an application that executes the following MySQL query: SELECT 402 AS user_id,
I have an application that executes this piece of code (JQuery 1.4.2) in an
I have a Winforms application that executes a stored procedure which examines several rows
We have a winform application that needs to display some results calculated on the

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.