public classgc { public static void main(String args[]) { System.gc(); System.out.println("garbage collection is required using system.gc()"); runtime.getruntime().gc(); System.out.println("garbage collection is required using system.gc()"); Sytsem.out.println("free menory:"+runtime.getruntime() freememory()+"bytes"); System.out.println("total memory:"+runtime.getruntime().totalmemory()+"bytes"); System.out.println("available processors"+runtime.getruntime()available processors()); runtime.getruntime().exit(0); System.out.println("this linewill not be executed"); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter