1 Reply Latest reply on Feb 16, 2011 3:13 PM by Marco La Senne

    Possible mem leak, and is  itOK to use Ctrl-C to terminate TOP or VMSTAT?

    marvin hecht
      Is this OK?

      I may be having a memory leak on our prod server. I've been running TOP every day or two, and I am losing 1GB of free memory per day.

      I am wondering if the act of Ctrl-C'ing out of TOP or VMSTAT itself grabs memory and uses it, and causes the OS not to re-release it, or am I safe to control c out of these?

      Also - ideas for tracing/ tracking a slow memory leak?

      This in on Solaris SPARC 64-bit box (t5220) with Solaris 10 update 8.

      Thanks Marvin.
        • 1. Re: Possible mem leak, and is  itOK to use Ctrl-C to terminate TOP or VMSTAT?
          Marco La Senne
          Hi Marvin,

          You can use umem to analyze memory leak from a binary or a script
          export UMEM_DEBUG=default UMEM_LOGGING=transaction
          LD_PRELOAD=libumem.so.1 ./your_binary_or_script
          ps -ef | grep a.out
          user1     970   714  0 10:42:42 pts/4    0:00 ./your_binary_or_script
          gcore 970
          mdb core.970
          Prints the status of the umem indicating if the logging features have been turned on or off
          Status:         ready and active
          Concurrency:    1
          Logs:           transaction=64k
          Message buffer:
          Prints a summary of the memory leaks found within the application
          0003d888       1 00050000 main+0xc
          Total       1 buffer, 24 bytes
          Prints the memory transactions initiated by the application and the correlated stack traces
          T-0.000000000  addr=55fb8  umem_alloc_32
          T-0.000457800  addr=49fc0  umem_alloc_24
          Prints the details about each of the umem caches
          ADDR     NAME                      FLAG    CFLAG  BUFSIZE  BUFTOTL
          0003c008 umem_magazine_1           000e 80080000        8        0
          0003c1c8 umem_magazine_3           000e 80080000       16        0
          0003c388 umem_magazine_7           000e 80080000       32        0
          0003c548 umem_magazine_15          000e 80080000       64        0
          0003c708 umem_magazine_31          000e 80080000      128        0
          0003c8c8 umem_magazine_47          000e 80080000      192        0
          0003ca88 umem_magazine_63          000e 80080000      256        0
          0003cc48 umem_magazine_95          000e 80080000      384        0
          0003ce08 umem_magazine_143         000e 80080000      576        0
          0003cfc8 umem_slab_cache           000e 80080000       28      170
          0003d188 umem_bufctl_cache         000e 80080000       12        0
          0003d348 umem_bufctl_audit_cache   000e 80080000      100      408
          0003d508 umem_alloc_8              020f 80000000        8        0
          0003d6c8 umem_alloc_16             020f 80000000       16        0
          0003d888 umem_alloc_24             020f 80000000       24      204
          0003da48 umem_alloc_32             020f 80000000       32      170
          Prints the umem transaction log for the application
            0 0002e064 00055fb8    10475e3dd1c98 00000001
            0 0002e000 00049fc0    10475e3d62050 00000001
              0003483c 00000000                0 00000000
              000348a0 00000000                0 00000000
              00034904 00000000                0 00000000
              ... snip ...
          Prints the integrity of the umem caches which is useful in determining if a buffer has been corrupted
          Cache Name                      Addr     Cache Integrity
          umem_magazine_1                    3c008 clean
          umem_magazine_3                    3c1c8 clean
          umem_magazine_7                    3c388 clean
          umem_magazine_15                   3c548 clean
          umem_magazine_31                   3c708 clean
          umem_magazine_47                   3c8c8 clean
          umem_magazine_63                   3ca88 clean
          umem_magazine_95                   3cc48 clean
          umem_magazine_143                  3ce08 clean
          umem_slab_cache                    3cfc8 clean
          umem_bufctl_cache                  3d188 clean
          umem_bufctl_audit_cache            3d348 clean
          umem_alloc_8                       3d508 clean
          umem_alloc_16                      3d6c8 clean
          umem_alloc_24                      3d888 corrupt buffer
          umem_alloc_32                      3da48 clean
          ... snip ...
          Edited by: user13104021 on Feb 16, 2011 4:08 PM