Results 1 to 8 of 8
  1. #1

    testing of memory

    what is memory leakege test?how do test the leakage?

  2. #2

    Re: testing of memory

    watch the available memory on the server and if it is continually being reduced and never goes up then you have a possible memory leak, if after stopping the test the memory is never returned to the pool then you definately have a memory leak. You can investigate this by watching the memory useage of each process in memeory, the one that follows the same pattern is your culpret

    Neil Cameron
    Test Tool Architect

  3. #3

    Re: testing of memory

    Memory Leak
    A bug caused by lack of sufficient memory (memory starvation), when an application continually requests portions of memory from the operating system but does not releases them. See allocation, de-allocation.

    A memory leak is the gradual loss of available computer memory when a program (an application/process or part of the operating system) repeatedly fails to return memory that it has obtained for temporary use. As a result, the available memory for that application or that part of the operating system becomes exhausted and the program can no longer function. For a program that is frequently opened or called or that runs continuously, even a very small memory leak can eventually cause the program or the system to terminate. A memory leak is the result of a program bug.

    Some operating systems provide memory leak detection so that a problem can be detected before an application or the operating system crashes. Some program development tools also provide automatic "housekeeping" for the developer. It is always the best programming practice to return memory and any temporary file to the operating system after the program no longer needs it.

    From searchWin2000.com.
    Roland Stens

  4. #4

    Re: testing of memory

    Also be aware that some environments (like java) use a memory heap rather than just continually taking from the system memory.

    Say you have your JVM setup to use a 512 meg heap. It will grab this amount of memory when the JVM starts and will only use this heap of memory it initially allocated. So in an instance like this, monitoring system memory will essentially tell you nothing. You may be leaking memory within your JVM and never realize it by looking if you don't monitor memory usage within that heap (not main system RAM).

    However, with newer programming languages that include garbage collection, memory leaks aren't as common as they once were (when memory was allocated explicitly within the program).
    Corey Goldberg
    Homepage: goldb.org
    Twitter: twitter.com/cgoldberg
    Google+: gplus.to/cgoldberg

  5. #5

    Re: testing of memory

    Beware of a trap that I have seen people fall into with Java. Depending on JVM versions and settings, the JVM may allocate a certain amount of memory to the heap initially, then continue to grow the heap dynamically as more memory is requested, up to the maximum size set for the heap.

    Monitoring at the OS level, it is easy to misinterpret that growth as a memory leak - when actually it is just that the JVM has decided that grabbing more memory from the OS is cheaper than running garbage collection. When it finally reaches the maximum allowed for the heap it will run garbage collection. However, the GC is only concerned with the internal usage of the heap - JVM process memory usage seen at the OS level will not change.

    I've seen people invoking frequent explicit garbage collections programatically to try to contain the memory growth. In the cases I've seen that has added huge overhead - GCs are expensive, which is why the JVM tries to avoid them. The fruitless search for non-existent memory leaks is fairly inefficient, too.

    This isn't to say that garbage collection should just be left alone - there are often major gains to be had by changing GC settings - but as Corey said - monitoring at the system level doesn't tell you what is happening, and can be very misleading.

  6. #6

    Re: testing of memory

    so what is a good way to detect memory leak ?

  7. #7
    Senior Member
    Join Date
    Apr 2003
    Wisconsin, USA

    Re: testing of memory

    One way I have seen of testing for memory leaks is to run an extended load test. Say for 24 or 48 hours. Not a stress test. A simple load test, at the expected capacity of the system. If you run out of memory, you know you have a leak.

  8. #8

    Re: testing of memory

    by load test/ stress test u wud sure get to know that there is a leak, but u wudn't be able to drill down to the code which causes it.
    running a memory profiler is the advisable thing.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:35 PM.

Copyright BetaSoft Inc.