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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:13:58+00:00 2026-06-11T10:13:58+00:00

I am having stability problems with OpenCMS. When i do a thread dump, many

  • 0

I am having stability problems with OpenCMS. When i do a thread dump, many threads (400) are waiting on the synchronized (m_processingFiles) block in the following code:

public class CmsJspLoader ... {
...

private static Set m_processingFiles = Collections.synchronizedSet(new HashSet());

...
...
...
public String updateJsp(...) {
....

while (m_processingFiles.contains(jspVfsName)) {
    // wait a little bit until the first thread finishes
    try {
        synchronized (m_processingFiles) {
            m_processingFiles.wait(100);
        }
    } catch (InterruptedException e) {
        // ignore
    }
}
...
}
...
}

The code is part of OpenCMS.
There is no notify() anywhere in the code. There is no change of state or reading shared variable inside the shown sync block.
However, there are 400 threads waiting on it, that means, just to pass through this sync the last one should wait 40sec!!!

I simply do not understand the purpose of it. Is there something i am not seeing?

  • 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-11T10:14:00+00:00Added an answer on June 11, 2026 at 10:14 am

    There must be some place in the code where a thread adds jspVfsName to m_processingFiles, does some more work, and then removes jspVfsName from m_processingFiles. If this wasn’t the case, then your other threads would simply wait() forever in that while loop. For some reason, the implementer didn’t want any other threads to execute updateJsp while that other processing is going on.

    I recommend you examine the code to see what jspVfsName actually is, and find where in the code it could be added/removed from m_processingFiles. Perhaps then you will also understand why the author didn’t want updateJsp to run while jspVfsName is in m_processingFiles.

    Once you find that, you can examine that “other” code to see if jspVfsName could ever be added to m_processingFiles and never removed. If so, that would (naturally) cause livelock, which would explain your stability problems.

    Or could it be that updateJsp is being called very frequently, and the “other” code which modifies m_processingFiles is also being called very frequently, to the point that it causes a major concurrency bottleneck? Could there be something wrong with your app which is causing updateJsp to be called more often than it should (perhaps on every request, rather than every time new JSP files are placed on the server)?

    If updateJsp is running very frequently, but it’s not caused by a problem with your app, you could try simply shorten the wait() period. That shouldn’t hurt anything — it will just make the waiting threads check whether jspVfsName is still in m_processingFiles more frequently. 100ms is a long, long time in CPU terms!

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

Sidebar

Related Questions

Having the following code: int main(int argc, char* argv[]) { // program code std::cout
Having the following code: template<typename T, typename OutStream = std::ostream> struct print { OutStream
Having the following code: #include <iostream> struct A { int x; A(){} ~A(){std::cout <<~A(<<x<<)\n;}
Having a spot of trouble with the following code. The method NextIPID() should simply
Having trouble with each function... Will try to explain by example... In my code,
Having trouble accessing javascript code in a mixed html/js ajax response. jQuery ajax doc
having a file with the following for example: DEFINE('INTERESTS_1','a'); DEFINE('INTERESTS_2','d'); DEFINE('INTERESTS_3','g'); DEFINE('INTERESTS_4','c'); Is it
Having the following domain class: class Message{ } Want to get all messages with
Having C++ console utility. The code inside parses the command line input and depending
Having already read a number of articles on this here is the code I've

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.