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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:58:37+00:00 2026-05-27T22:58:37+00:00

Edit : Of the several extremely generous and helpful responses this question has already

  • 0

Edit: Of the several extremely generous and helpful responses this question has already received, it is obvious to me that I didn’t make an important part of this question clear when I asked it earlier this morning. The answers I’ve received so far are more about optimizing applications & removing bottlenecks at the code level. I am aware that this is way more important than trying to get an extra 3- or 5% out of your JVM!

This question assumes we’ve already done just about everything we could to optimize our application architecture at the code level. Now we want more, and the next place to look is at the JVM level and garbage collection; I’ve changed the question title accordingly. Thanks again!


We’ve got a “pipeline” style backend architecture where messages pass from one component to the next, with each component performing different processes at each step of the way.

Components live inside of WAR files deployed on Tomcat servers. Altogether we have about 20 components in the pipeline, living on 5 different Tomcat servers (I didn’t choose the architecture or the distribution of WARs for each server). We use Apache Camel to create all the routes between the components, effectively forming the “connective tissue” of the pipeline.

I’ve been asked to optimize the GC and general performance of each server running a JVM (5 in all). I’ve spent several days now reading up on GC and performance tuning, and have a pretty good handle on what each of the different JVM options do, how the heap is organized, and how most of the options affect the overall performance of the JVM.

My thinking is that the best way to optimize each JVM is not to optimize it as a standalone. I “feel” (that’s about as far as I can justify it!) that trying to optimize each JVM locally without considering how it will interact with the other JVMs on other servers (both upstream and downstream) will not produce a globally-optimized solution.

To me it makes sense to optimize the entire pipeline as a whole. So my first question is: does SO agree, and if not, why?

To do this, I was thinking about creating a LoadTester that would generate input and feed it to the first endpoint in the pipeline. This LoadTester might also have a separate “Monitor Thread” that would check the last endpoint for throughput. I could then do all sorts of processing where we check for average end-to-end travel time for messages, maximum throughput before faulting, etc.

The LoadTester would generate the same pattern of input messages over and over again. The variable in this experiment would be the JVM options passed to each Tomcat server’s startup options. I have a list of about 20 different options I’d like to pass the JVMs, and figured I could just keep tweaking their values until I found near-optimal performance.

This may not be the absolute best way to do this, but it’s the best way I could design with what time I’ve been given for this project (about a week).

Second question: what does SO think about this setup? How would SO create an “optimizing solution” any differently?

Last but not least, I’m curious as to what sort of metrics I could use as a basis of measure and comparison. I can really only think of:

  • Find the JVM option config that produces the fastest average end-to-end travel time for messages
  • Find the JVM option config that produces the largest volume throughput without crashing any of the servers

Any others? Any reasons why those 2 are bad?

After reviewing the play I could see how this might be construed as a monolithic question, but really what I’m asking is how SO would optimize JVMs running along a pipeline, and to feel free to cut-and-dice my solution however you like it.

Thanks in advance!

  • 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-27T22:58:37+00:00Added an answer on May 27, 2026 at 10:58 pm

    Let me go up a level and say I did something similar in a large C app many years ago.
    It consisted of a number of processes exchanging messages across interconnected hardware.
    I came up with a two-step approach.

    Step 1. Within each process, I used this technique to get rid of any wasteful activities.
    That took a few days of sampling, revising code, and repeating.
    The idea is there is a chain, and the first thing to do is remove inefficiences from the links.

    Step 2. This part is laborious but effective: Generate time-stamped logs of message traffic.
    Merge them together into a common timeline.
    Look carefully at specific message sequences.
    What you’re looking for is

    1. Was the message necessary, or was it a retransmission resulting from a timeout or other avoidable reason?
    2. When was the message sent, received, and acted upon? If there is a significant delay between being received and acted upon, what is the reason for that delay? Was it just a matter of being “in line” behind another process that was doing I/O, for example? Could it have been fixed with different process priorities?

    This activity took me about a day to generate logs, combine them, find a speedup opportunity, and revise code.
    At this rate, after about 10 working days, I had found/fixed a number of problems, and improved the speed dramatically.

    What is common about these two steps is I’m not measuring or trying to get “statistics”.
    If something is spending too much time, that very fact exposes it to a dilligent programmer taking a close meticulous look at what is happening.

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

Sidebar

Related Questions

This seems like such a simple question. I have several Edit boxes on my
I have a Win32 GUI application that has several edit controls (plain old EDIT
**EDIT: There are several options below that would work. Please vote/comment according to your
I have an application that has several stores , and each store has several
I'd like to make a connection to Geoserver to edit several point of a
George Marsaglia has written an excellent random number generator that is extremely fast, simple,
I have to make edit/create forms for several tables on one page (settings). Therefore
Edit: fixed several syntax and consistency issues to make the code a little more
Casus: How to edit and advance with the same code, from several distanced locations
EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm

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.