Results 1 to 9 of 9
Like Tree1Likes
  • 1 Post By Tolls

Thread: Edem memory segment increasing while process waits

  1. #1
    voipp is offline Member
    Join Date
    Oct 2013
    Posts
    51
    Rep Power
    0

    Unhappy Edem memory segment increasing while process waits

    Hi!
    I run JVM visualization with GC visualizator. I have simple program , that waits for user to input data (to InputStreamReader). I noticed that Edem memory increases itself without any memory initialization, and of course garbage collector acts everytime this memory gets full. What is the reason of this, confusing me, increase of memory ?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,039
    Rep Power
    20

    Default Re: Edem memory segment increasing while process waits

    What is the program doing while you monitor the heap?
    gimbal2 likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,050
    Rep Power
    6

    Default Re: Edem memory segment increasing while process waits

    That's a good thing to mention; I've seen myself that when using JVisualVM, it is actually the act of continuously monitoring a running application that can already cause it to see its memory usage to rise gradually and then drop again on a full garbage collection; simply because the collected information also results in objects being created.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    voipp is offline Member
    Join Date
    Oct 2013
    Posts
    51
    Rep Power
    0

    Default Re: Edem memory segment increasing while process waits

    Quote Originally Posted by Tolls View Post
    What is the program doing while you monitor the heap?
    program just creates ListArray and waits for user to standart input

  5. #5
    voipp is offline Member
    Join Date
    Oct 2013
    Posts
    51
    Rep Power
    0

    Default Re: Edem memory segment increasing while process waits

    Quote Originally Posted by gimbal2 View Post
    That's a good thing to mention; I've seen myself that when using JVisualVM, it is actually the act of continuously monitoring a running application that can already cause it to see its memory usage to rise gradually and then drop again on a full garbage collection; simply because the collected information also results in objects being created.
    i dont understand you. How collected information also results in objects being created cause Eden memory to increase while program waits for user to standart input

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,050
    Rep Power
    6

    Default Re: Edem memory segment increasing while process waits

    Its not the program waiting, its the program measuring that is doing it. The program needs to get its information from the JVM that you are measuring, and that JVM being Java will create objects to provide the measuring tool with information, and thus (temporarily) increase its internal memory usage.

    I'm not saying that it is happening in your case, I'm saying that it is POSSIBLE that it happens.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,039
    Rep Power
    20

    Default Re: Edem memory segment increasing while process waits

    Have you got your code that shows this?
    Even a simplified version?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  8. #8
    voipp is offline Member
    Join Date
    Oct 2013
    Posts
    51
    Rep Power
    0

    Default Re: Edem memory segment increasing while process waits

    Quote Originally Posted by Tolls View Post
    Have you got your code that shows this?
    Even a simplified version?
    you are welcome :

    Java Code:
    import java.io.*;
    import java.util.*;
    
    public class App {
    
      private static List objects = new ArrayList();
      private static boolean cont = true;
      private static String input;
      private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    
      public static void main(String[] args) throws Exception {
        System.out.println("Welcome to Memory Tool!");
    
        //------------------- print jvm system variables
        System.out.println("jvm system properties");
        System.out.println(System.getProperty("java.class.path"));
        //System.out.println(System.getProperty(key));
        
        //-------------------
        
    //    while (cont) {
    //      System.out.println(
    //        "\n\nI have " + objects.size() + " objects in use, about " +
    //        (objects.size() * 10) + " MB." +
    //        "\nWhat would you like me to do?\n" +
    //        "1. Create some objects\n" +
    //        "2. Remove some objects\n" +
    //        "0. Quit");
    //      input = in.readLine();
    //      if ((input != null) && (input.length() >= 1)) {
    //        if (input.startsWith("0")) cont = false;
    //        if (input.startsWith("1")) createObjects();
    //        if (input.startsWith("2")) removeObjects();
    //      }
    //    }
        
        input = in.readLine();
    
        System.out.println("Bye!");
      }
    Last edited by Tolls; 12-05-2013 at 11:40 AM.

  9. #9
    voipp is offline Member
    Join Date
    Oct 2013
    Posts
    51
    Rep Power
    0

    Default Re: Edem memory segment increasing while process waits

    Quote Originally Posted by gimbal2 View Post
    Its not the program waiting, its the program measuring that is doing it. The program needs to get its information from the JVM that you are measuring, and that JVM being Java will create objects to provide the measuring tool with information, and thus (temporarily) increase its internal memory usage.

    I'm not saying that it is happening in your case, I'm saying that it is POSSIBLE that it happens.
    suppose , it is some complicated algorithm is doing

Similar Threads

  1. Calculating segment costs
    By sezzy in forum New To Java
    Replies: 4
    Last Post: 11-16-2012, 02:32 PM
  2. How to increase Memory to java runtime process
    By gianpiero.guerrera82 in forum Advanced Java
    Replies: 0
    Last Post: 10-31-2011, 10:37 AM
  3. Replies: 1
    Last Post: 04-08-2010, 09:45 PM
  4. Read Process Memory
    By newms86 in forum New To Java
    Replies: 2
    Last Post: 07-07-2008, 05:14 PM
  5. Replies: 1
    Last Post: 08-03-2007, 06:17 PM

Posting Permissions

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