Created
          August 21, 2012 14:22 
        
      - 
      
- 
        Save nicokruger/3415941 to your computer and use it in GitHub Desktop. 
    Getting java heap usage using jstat
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | jdk1.7.0/bin/jstat -gccapacity 9043 | tail -n 1 | awk '{ print $4, $5, $6, $10 }' | python -c "import sys; nums = [x.split(' ') for x in sys.stdin.readlines()]; print(str(sum([float(x) for x in nums[0]]) / 1024.0) + ' mb');" | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment