Jvm memory growth troubleshooting examples and jvm troubleshooting examples

Source: Internet
Author: User

Jvm memory growth troubleshooting examples and jvm troubleshooting examples
Troubleshoot jvm memory Growth

Troubleshoot the problem that the jvm memory usage continues to increase. record it and take it as a warning.

The O & M team found that the jvm memory usage of the application fell back after the release and continued to increase. After dumping, it analyzed:

Public <T> T getScriptedObject (String scriptName, String scriptSource, Class <T> cls) {if (StringUtils. isEmpty (scriptSource) throw new RuntimeException ("service script" + scriptName + "blank"); policyobject goo = null; Class clz = null; try {clz = policyclassloader. parseClass (scriptSource); goo = (policyobject) clz. newInstance (); if (null! = BeanFactory) {beanFactory. autowireBeanProperties (goo, 1, true) ;}} catch (UnsatisfiedDependencyException ex) {// ex. printStackTrace ();} catch (Exception ex) {logger. error ("script {} exception: {}", scriptName, ex); throw new RuntimeException (ex);} if (cls. isAssignableFrom (goo. getClass () {return (T) goo;} else {throw new RuntimeException ("script" + scriptName + "error ");}}

 

The bean Generation Code must be multiple examples:
BeanFactory. autowireBeanProperties (goo, 1, true );
Sure enough:

 

The solution is to add a cached map on the outer layer to ensure the singleton. This will lead to the loss of the advantage of convenient logic modification without the release of scripts. Therefore, we need to implement a map clearing function, it can be triggered manually or periodically.
The problem is solved because the internal implementation of spring api is not well understood during development.

 

--------------------------

Thank you ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.