Problems arise

Received the test message, the project page is slow to open.

Troubleshoot problems

  1. A look at the online JVM monitoring platform shows pauses due to GC in the 30 to 50’s per minute range.

  2. Jstat-gccause PID time was performed on the on-line machine, and it was found that the proportion of the old age was always about 99%, with little change after full GC.

    Then, by looking at the online GC log, you can see that the space in the old years is basically unchanged before and after full GC. (Probably a memory leak)

  1. Therefore, jmap the entire dump file. After the dump file was generated, the online machine was restarted first (because it was an old project and had not been restarted recently, so basically it could be determined that it was not due to the logic problem of business code, so restart first to ensure online availability. After the restart, observe the memory status and find that it is normal.
  2. Long waiting for the dump file to download (only 3.47G, the company’s network was down for nearly 2 hours, the main obstacle to troubleshooting is the company’s network).

The analysis reason

  1. Jprofiler opens the dump file. The size of char[] and the number of ConcurrentHashMap$Node are extremely suspicious.

  1. Switch to Biggest Objects. Found that the object exists a FallbackModuleMappingRule ConcurrentHashMap object called cache size of 2475 MB (online old s 2.5 G).

  1. Check the specific node information of the map and find that the path of the URL and its corresponding Module (Webx3 project) are saved.

  1. Look at the FallbackModuleMappingRule this class, found that the module is used for mapping the relationship with the class in the screen. The reason that the PATH of the URL appears is because the URL is encoded, right? %3F is rounded to %3F, and the entire path is assumed to be path, so the entire path is used when module cannot be found.

  2. You shouldn’t have urls that are encoded multiple times. So I went to the link and looked at the user-agent with similar request, and found that it was the search engine spider. (Shit, can’t you be professional? If you want to climb, just climb.)

    %253F decoded once is %3F, decoded again is %3F? .

The solution

  1. Filter Processes the URL.
  2. Reflection FallbackModuleMappingRule cache, emptied.
  3. .

ps

It’s too hard to maintain old projects.

Recommended 🎵 “I will tell you when problems arise”