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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:59:24+00:00 2026-06-15T23:59:24+00:00

I am using Spring3.1 on a standalone env. (this problem not necessary related to

  • 0

I am using Spring3.1 on a standalone env.

(this problem not necessary related to Spring. it’s behaving the same also on a standalone env.)

I have implements a listener which receives messages from Topic. the messages rate is very very high (talking about 20/30 m/s).

some messages can take more processing time then other.

The listener works with the same instance which means that if one message being processed too long it hits our performances pretty much.

We thought about doing our own pool of objects instead of using the same listener instance but then I found out the Executors(java.util.concurrent.Executors).

So for each message received a different thread will be allocated to it. this will make sure our listener instance will be free to process messages parallel.

private ExecutorService  threadPool = Executors.newFixedThreadPool(100);
    @Override
    public void onMessage(final Message msg)
    {
        Runnable t = new Runnable()
        {
            public void run()
            {
                onSessionMessage(msg);
                log.trace("AbstractSessionBean, received messge");
            }
        };
        threadPool.execute(t);
    }

That seems to solve our performance issue. but after monitoring the application with jconsole we facing now huge memory leaks.

The heap memory usage being increased significantly in time.

So I tried to “play” a bit with the FixedThreadPool size number. still having huge memory usage:

enter image description here

Any idea how can I solve this? any other ideas to solve my key problem?

jconsole after performing GB

jconsole overall view

After running heap dump I got two problem suspects:

Head Dump

thanks,
ray.

  • 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-15T23:59:25+00:00Added an answer on June 15, 2026 at 11:59 pm

    I think you have no problem with memory leak, I cannot see it from your jconsole chart at least. There is no major GC collection. So it seems only more and more objet allocated into tenured(old) generation. To ensure about memory leak you should Perform GC and after that compare allocated memory. If you find a leak you are able to make a heap dump with jmap or visual tool(standart JDK tools). After this heap dump can be analyzed with MAT. Before taking heap dump it is better to Perform GC to decrease heap dump file size.

    Some notes:

    • Threads count shouldn’t affect heap memory explicitly. It maybe useful for you to review next java memory structure. So thread require stack memory not a heap.
    • In general it is not good idea to create cache for not heavy object, because of GC works algorithm.
    • Also I think you should consider cached thread pool or calibrate ThreadPoolSize according server hardware.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Spring 3.1 on standalone env. I have scenario where I am
I am using Spring3.1 in a standalone env. Although I am using Spring I
I am using Spring3.1 on standalone env. I set topic with jms templates this
I am using Spring3.1 in standalone Env. I am trying to cache my entries.
I am using Spring3.1 in standalone Env. I am caching my entry using @Cachable
Here is the problem. I have spring 3.0.5, using its new DATA JPA repository
Using Spring 2.5 tag library, I have an Integer value in a command form
I am using spring mvc in my application,when i created user i have to
I asked a question yesterday ( Using Spring in standalone apps ) on how
I'm having some issues with Jetty7 standalone and my spring web app using jsp/jstl/el.

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.