problem Reason
The production server's memory has been elevated until it is down. The memory analysis concludes that memory leaks.
Download the dump file, after the parse stack log, as shown in the following figure:
The class "Javax.crypto.JceSecurity", Loaded by "<system class Loader>", occupies 2,522,379,928 (95.73%) bytes. The memory is accumulated in one instance of ' java.lang.object[' Loaded by ' <system class loader> '. Keywords
java.lang.object[]
javax.crypto.JceSecurity
is bouncycastleprovider this class inside the method, all is static, new one more than one, GC does not recycle, slowly on the downtime.
The dump code is as follows:
Solution
private static Org.bouncycastle.jce.provider.BouncyCastleProvider Bouncycastleprovider = null;
public static synchronized Org.bouncycastle.jce.provider.BouncyCastleProvider getinstance () {
if ( Bouncycastleprovider = = null) {
Bouncycastleprovider = new Org.bouncycastle.jce.provider.BouncyCastleProvider ();
return
bouncycastleprovider;
}
Keypairgenerator Keypairgen = keypairgenerator.getinstance ("RSA", getinstance ());
Memory leak analysis tool See also: http://blog.csdn.net/shenhaiwen/article/details/54670234