Find the answer to your Linux question:
Results 1 to 8 of 8
I have java multi thread socket application running on Centos 6.4 what we notice is RES value is cross 400m which is more then the allocated max heap that is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    72

    RSS memory not tallying with Java Heap


    I have java multi thread socket application running on Centos 6.4 what we notice is RES value is cross 400m which is more then the allocated max heap that is 256m. According to jstat results as below there is no GC happening is this alarming situation? What proactive measures can be taken before things goes worse? The worrying part now is that the RSS keep increasing and below is both my jstat results and also MAT. So what is your suggestion based on the results below.


    Code:
    Timestamp         S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT   
          2331438.3  56.95   0.00  62.79  82.79  80.37   1362   54.337     0    0.000   54.337
          2331443.3  56.95   0.00  62.79  82.79  80.37   1362   54.337     0    0.000   54.337
          2331448.4  56.95   0.00  62.79  82.79  80.37   1362   54.337     0    0.000   54.337
          2331453.4  56.95   0.00  62.79  82.79  80.37   1362   54.337     0    0.000   54.337
          2331458.4  56.95   0.00  62.79  82.79  80.37   1362   54.337     0    0.000   54.337
          2331463.4  56.95   0.00  62.79  82.79  80.37   1362   54.337     0    0.000   54.337
          2331468.4  56.95   0.00  62.79  82.79  80.37   1362   54.337     0    0.000   54.337
          2331473.4  56.95   0.00  63.24  82.79  80.37   1362   54.337     0    0.000   54.337
          2331478.4  56.95   0.00  63.24  82.79  80.37   1362   54.337     0    0.000   54.337
          2331483.4  56.95   0.00  63.78  82.79  80.37   1362   54.337     0    0.000   54.337
          2331488.4  56.95   0.00  63.78  82.79  80.37   1362   54.337     0    0.000   54.337
          2331493.4  56.95   0.00  63.79  82.79  80.37   1362   54.337     0    0.000   54.337
          2331498.4  56.95   0.00  63.79  82.79  80.37   1362   54.337     0    0.000   54.337


    HTML Code:
    Problem Suspect 1 
    
    One instance of "org.jboss.netty.channel.socket.oio.OioWorker" loaded by "org.rzo.yajsw.boot.WrapperClassLoader @ 0xf0002a50" occupies 49,451,672 (75.12%) bytes. 
    
    Keywords
    org.rzo.yajsw.boot.WrapperClassLoader @ 0xf0002a50
    org.jboss.netty.channel.socket.oio.OioWorker
    
    Problem Suspect 2
    
    The class "java.lang.ref.Finalizer", loaded by "<system class loader>", occupies 10,408,112 (15.81%) bytes. 
    
    Keywords
    java.lang.ref.Finalizer

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,397
    What does the JMX api's tell you? What are your Java command-line or configuration options regarding GC and heap?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    72
    Hi rubberman,
    I am not using any JMX here. I just configured for heap where both initial and max is 256MB. IS that anything else I should do please advice? Thank you.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,397
    Quote Originally Posted by newbie14 View Post
    Hi rubberman,
    I am not using any JMX here. I just configured for heap where both initial and max is 256MB. IS that anything else I should do please advice? Thank you.
    I'm not sure. I can code well in Java, but I am not a Java guru. I'll have to ask some of the experts at the office next week if they know about this issue.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Jul 2010
    Posts
    72
    Hi Rubberman,
    Thank you for you concern and help yes will definitely need your input on why this is behaving like this or its normal behavior till a certain extend?

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,397
    Sorry I have been so long responding to this, but I've been up to my eyeballs these past couple of weeks. I'll try to remember to ask one of my Java wizards at work next week (given that it is now Friday going on Saturday)...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    33
    Take a look in the JRE folder for the javacpl binary, its the java control panel, invoke that and see if there is anything there to help on it.

    In your startup java command-line you can allocate the java stack heap and object stack size in "m" , the last i heard it only goes as high as 256m but that's back in Sun Oracle JRE / JDK 1.5.0 or older.


    Type java -? or java -help at the prompt
    and also type java -X at the prompt

    and you get this...


    C:\Documents and Settings\iv48\Desktop>cd c:\

    C:\>cmd.exe
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\>java -h
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)

    where options include:
    -client to select the "client" VM
    -server to select the "server" VM
    -hotspot is a synonym for the "client" VM [deprecated]
    The default VM is client.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument

    -splash:<imagepath>
    show splash screen with specified image

    C:\>java -X
    -Xmixed mixed mode execution (default)
    -Xint interpreted mode execution only
    -Xbootclasspath:<directories and zip/jar files separated by ;>
    set search path for bootstrap classes and resources
    -Xbootclasspath/a:<directories and zip/jar files separated by ;>
    append to end of bootstrap class path
    -Xbootclasspath/p:<directories and zip/jar files separated by ;>
    prepend in front of bootstrap class path
    -Xnoclassgc disable class garbage collection
    -Xincgc enable incremental garbage collection
    -Xloggc:<file> log GC status to a file with time stamps
    -Xbatch disable background compilation
    -Xms<size> set initial Java heap size
    -Xmx<size> set maximum Java heap size
    -Xss<size> set java thread stack size
    -Xprof output cpu profiling data
    -Xfuture enable strictest checks, anticipating future default
    -Xrs reduce use of OS signals by Java/VM (see documentation)
    -Xcheck:jni perform additional checks for JNI functions
    -Xshare:off do not attempt to use shared class data
    -Xshare:auto use shared class data if possible (default)
    -Xshare:on require using shared class data, otherwise fail.

    The -X options are non-standard and subject to change without notice.

    C:\>

    Here's the sort of thing from one of my classes

    Code:
    //Written by Mr Samuel A Marchant(Sydney NSW Australia) nicephotog@gmail.com COMPILED Mon, Nov 21, 2011  MS-Win JDK 1.5.0_03
    
    import java.io.*;
    class WinStarterMotor
    {
      
    final String app_Classpath_PATH=System.getProperty("java.class.path");
    final String flsep=System.getProperty("file.separator");
    RandomAccessFile argread;
    File fargs;
    String[] ar;
    String cr;
        WinStarterMotor(String[] ar)
        {
    this.ar=ar;
    cr="";
    
    
    
    // if wrapper for exists()
    String argfilename=app_Classpath_PATH+flsep+"89273497626commline.txt";
    //System.out.println("argfilename: "+argfilename);
    fargs = new File(argfilename);
    if(fargs.exists()==true){
    //System.out.println("argfilename: appears to be true");
      long sk=0;
      long agflen=0;
      try{
    argread = new RandomAccessFile(fargs,"r");
    agflen=argread.length();
    argread.seek(sk);
    byte[] bfularg=new byte[((int)new Long(agflen).intValue())];
    argread.readFully(bfularg,0,((int)new Long(agflen).intValue()));
    cr=new String(bfularg);
    //System.out.println("cr: "+cr);
    argread.close();
    fargs.delete();
    }catch(java.io.FileNotFoundException filnot){
    stackExPasthru(filnot);
    }catch(java.io.IOException excpio){
    stackExPasthru(excpio);
    }catch(Exception exep){
    stackExPasthru(exep);
      }finally{}
    
    }else if(ar.length > 0){
    if(ar[0].length()>5){
    cr=ar[0];
    }
    }else{
     cr="";
      }//enifels
    
    
    //System.out.println("cr: "+cr);
            try
            {
                String preix = "java.exe -classpath \""; // obj-heap process heap java.exe -X -h for non standard commandline args
                File pthFold = new File(".\\");
                String pthF = pthFold.getCanonicalPath().toString();
                String ensec = pthF + ".\\engine\";. -Xms256m -Xmx768m SidewinderPhotoColourBalancer"+" \""+cr+"\"";
                String runit = preix + ensec;
                Process pr = Runtime.getRuntime().exec(runit);
            }
            catch(FileNotFoundException fnoffn)
            {
             stackExPasthru(fnoffn);
                System.out.print("File cannot be located \"Filename\"  " + fnoffn.getMessage());
            }
            catch(IOException stinou)
            {
              stackExPasthru(stinou);
                System.out.print("Error writing the file onto the disk ->IO  " + stinou.getMessage());
            }
            finally{}
            System.exit(0);
        }
    
    public static void main(String Args[]){
            new WinStarterMotor(((String[])Args));
    }
        
    void stackExPasthru(Throwable thrower){
    try{
    new StackPrinterPasthrough(thrower);
    }catch(java.io.IOException iniyti){
    
    }catch(Exception eiyti){
    
    }finally{}
    } // enmeth
    
    
    }//enclss
    
    
    /***********************************************************************/
    
    class StackPrinterPasthrough extends Throwable{
    String flsep=System.getProperty("file.separator");
    String wnei = System.getProperty("os.name");
    final String app_Classpath_PATH=System.getProperty("java.class.path");
    String app_PATH="";
    String errF="";
    //
    StackPrinterPasthrough(Throwable inputEXC)throws IOException,FileNotFoundException,Exception{
    
    // windows -> app_PATH=""+app_Classpath_PATH.substring(0,(app_Classpath_PATH.length()-9)); // \engine [+2 windows -> ";." ]
    errF=app_PATH+flsep+"dat"+flsep+"errTraceSidewinder.txt";
    java.io.File errFil=new java.io.File(errF);
    java.io.PrintStream pr=new java.io.PrintStream(((OutputStream)new java.io.FileOutputStream(errFil,true)));
    inputEXC.printStackTrace(pr);
    } // enconstr
    } // enclss
    
    
    /***********************************************************************/

  8. #8
    Just Joined!
    Join Date
    Jul 2010
    Posts
    72
    Dear Nice,
    I am using Centos machine with no gui in it. Will it apply the same I have set both the initial and max heap to 256M already what else can I configure please ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •