$ java -XX:+PrintFlagsFinal -version | grep ParallelGCThreads
uintx ParallelGCThreads = 8 {product}
uintx ParallelGCThreads = 8 {product}
茌成的博客 (AKA joychester) IF you think it is helpful, Take it away for free :)
ps aux | awk '{print $6/1024 " MB\t\t" $11 " PID\t" $2}' | sort -n
"org.apache.http.conn.ConnectionPoolTimeoutException:
Timeout waiting for connection from pool at
org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(ConnPoolByRoute.java:412) at
org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPoolByRoute.java:298) at
org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConnection(ThreadSafeClientConnManager.java:238) at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:422) at
org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863) at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106) at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57) at
...... "
Here are some Good posts on Detecting HTTP Connection Leak and How to test connection leaksudo -u {UID} /opt/java/bin/jcmd {PID} VM.native_memory baseline
sudo -u {UID} /opt/java/bin/jcmd {PID} VM.native_memory summary.diff
java.io.IOException: Operation not permitted
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loadedThis could give you some high level idea if you have the Native memory leak or not, but which Object brings you trouble , Since NMT doesn't track memory allocations by non-JVM code, you can use jemalloc / pmap to detect memory leaks in native code, few good posts for your reference : http://jenshadlich.blogspot.com/2016/08/find-native-memory-leaks-in-java.html
//calculate page loading time by resource timing API
var perfEntries = performance.getEntries();
var end_probe = perfEntries.filter(function(item) {
//page load finish request indicator
if (item.name.indexOf('/req_url_end') > -1) {
console.log(item.name);
return true;
}
});
if(end_probe.length > 0) {
var end_time = end_probe[0].responseEnd;
var start_probe = perfEntries.filter(function(item) {
//page load start indicator
if (item.name.indexOf('/req_url_start') > -1) {
console.log(item.name);
return true;
}
});
var start_time = start_probe[0].startTime;
var duration = end_time - start_time;
console.log(duration);
} else {
console.log("page loading end indicator is not found, please double check all perf Entries");
}
There is a better way to combine User Timing API and Resource Timing API to get accurate page performance, i am using Nightmare APIs as a sample to do the automated page tests, which can help our continuous page performance test process on daily basis:
var url = "http://www.yourhost.com/abc/def/";
var page_complete_idy = 'key_request_name'; //page indicator by resource name
var tag = 'ReviewPage';
var env_name = 'prod';
const RENDER_TIME_MS = 2000;
var Nightmare = require('nightmare'),
nightmare = Nightmare({show: true, switches: {
'ignore-certificate-errors': true
}});
nightmare
.goto(url)
.wait(function(idy){
var perfEntries = window.performance.getEntries();
if (perfEntries.length > 20) {
return perfEntries.some( function (item) {
if (item.name.includes(idy)) {
return true;
}
});
} else {
return false;
}
}, page_complete_idy)
.evaluate(function(idy){
var perfEntries = window.performance.getEntries();
var perf_obj = perfEntries.find(function (item) {
return item.name.includes(idy)
});
if (perf_obj) {
return perf_obj.responseEnd.toFixed(1);
} else {
return 'undefined'
}
}, page_complete_idy)
.end()
.then( function (duration) {
console.log(tag + ":" + duration);
})