codes for: http://p.rogram.me/java.profiling/