Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4068639

Memory Leak(s)

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1.6
    • CPU:
      x86
    • OS:
      windows_95
    • Verification:
      Verified

      Description

      The win_95 version of JWS appears to have one or more memory leaks. Try the following:

      - Start up the Win95 System Monitor (note, this is not installed by default.
      You may need to install it from the CD or download it from MicroSoft).

      - Select Memory Manager: Free Memory and Memory Manager: Swapfile in use as the
      quantities to monitor.

      - Start up JWS. Load the following program:

      public class MorePrimes {

          /**
           * Constructor.
           */
          public MorePrimes () {
          }

          public static void main(String args[])
          {
      long [] primes = new long[10000];
      primes[0] = 2;
      primes[1] = 3;
      int count = 2;

      long number = 5;


      int len = primes.length;
      outer:
      for( ; count < len; number += 2)
      {
      long limit = (long)Math.ceil(Math.sqrt((double)number));

      for(int i = 1; i < count && primes[i] <= limit; i++)
      if(number%primes[i] == 0)
      continue outer;
      primes[count++] = number;
      }

      for(int i = 0; i < primes.length; i++)
      System.out.println(primes[i]);


          }
      }

      - Build the program. Do several more Build -> All's. Note that memory/swap
      used by the builder is not returned to the system when the build is complete.

      - Now, run the program. Note that the console window appears to be taking up
      lots of memory/swap and is not returning it to the system. Successive runs
      make the drain on system resources worse.

      - Note that Win 95 appears to grow it's swap space dynamicly. It takes it from
      the system disk. If you're realy patient, or your system disk is almost full,
      you will eventually get a message that JWS has performed an illegal operation
      and will be shut down. If you click details, you will get something like:

      JWS caused an invalid page fault in
      module JAVAI.DLL at 0137:1003029d.
      Registers:
      EAX=00000000 CS=0137 EIP=1003029d EFLGS=00010203
      EBX=000046f2 SS=013f ESP=05caf7b4 EBP=00002379
      ECX=000011bc DS=013f ESI=0114dcd0 FS=0f7f
      EDX=0114dcd0 ES=013f EDI=00000000 GS=0000
      Bytes at CS:EIP:
      f3 a5 8b cb 83 e1 03 f3 a4 85 d2 75 28 e8 21 d4
      Stack dump:
      05caf7f0 05cafefc 00002379 00000000 02274ce4 00e7f848 00000000 00002379 05cafefc 0113d5d8 00000000 00000767 00000767 008b7d30 00e7f848 05caf840


      The only work around is to shut down JWS periodicly and make sure your system disk does not get too full.

      sfoster@eng 1997-07-30

      ****

      Additional information:

      Instead of the above page fault, you might get:

      JWS caused an invalid page fault in
      module WINAWT.DLL at 0137:0226834d.
      Registers:
      EAX=00000000 CS=0137 EIP=0226834d EFLGS=00010246
      EBX=0000439e SS=013f ESP=0294f7a0 EBP=0000873c
      ECX=000021cf DS=013f ESI=00000000 FS=2aaf
      EDX=c10cf330 ES=013f EDI=00000000 GS=0000
      Bytes at CS:EIP:
      f3 ab 8b cd 53 83 e1 03 f3 aa 8b 44 24 14 56 8b
      Stack dump:
      bff622d3 0494a190 008d4d4c 00004ee4 0000439e 0227524d 0494a190 0294f7f0 0294fefc 010c3c38 00000000 02274bfd 00dd6208 0294fefc 010c3c38 00000000

      sfoster@eng 1997-08-04

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lbunnisunw Lara Bunni (Inactive)
              Reporter:
              sgfoster Stephen Foster (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: