Small question


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Small question

  1. #1
    Charlie Guest

    Small question


    Is it possible to have java check to see how much memory a particular
    program is chewing? Preferably every second.


    The program whose memory needs to be checked is a windows NT based program
    suspected to have a memeory leak!!


    A speedy reply would be appreciated


    Cheers Charlie

  2. #2
    Nikhil Guest

    Re: Small question


    Hi,
    I am not sure. Can you please try the following in the code

    Runtime.getRuntime().freeMemory() at the beginning and at the end of the
    method. It will give you the memory used for that method. Please let me know
    whether it is OK or not..

    Nikhil

    "Charlie" <pjvelzeboer@lineone.net> wrote:
    >
    >Is it possible to have java check to see how much memory a particular
    >program is chewing? Preferably every second.
    >
    >
    >The program whose memory needs to be checked is a windows NT based program
    >suspected to have a memeory leak!!
    >
    >
    >A speedy reply would be appreciated
    >
    >
    >Cheers Charlie



  3. #3
    Dave Whelan Guest

    Re: Small question


    It seems to me that Java isn't to relevent to this problem.If its an NT program
    the why not just take a look at the task manager. It updates every second
    and details the memory usage of each process!

    "Charlie" <pjvelzeboer@lineone.net> wrote:
    >
    >Is it possible to have java check to see how much memory a particular
    >program is chewing? Preferably every second.
    >
    >
    >The program whose memory needs to be checked is a windows NT based program
    >suspected to have a memeory leak!!
    >
    >
    >A speedy reply would be appreciated
    >
    >
    >Cheers Charlie



  4. #4
    Jo Desmet Guest

    Re: Small question


    "Dave Whelan" <whelandj@tcd.ie> wrote:
    > It seems to me that Java isn't to relevent
    > to this problem. If its an NT program then
    > why not just take a look at the task manager.
    > It updates every second and details the
    > memory usage of each process!


    I totally agree. But probably then comes the
    question of where the memory goes, and how to
    control it.

    Memory usage (on the heap) can be controlled by
    using the -Xms and -Xmx parameters of the sun java
    tool. There is a nice article on this on IBM's
    developerWorks site:
    http://www-4.ibm.com/software/develo...heap-size.html

    And for people who think that memory leaks are not
    possible in java, here is the cold shower:
    http://www.devx.com/upload/free/feat...699/tl0699.asp
    (or search on "memory leaks" at www.java-zone.com)
    java does not make clean design an thorough thinking unneeded, in fact it
    should invite you to do the exact opposite.


  5. #5
    Lesha Guest

    Re: Small question


    "Charlie" <pjvelzeboer@lineone.net> wrote:
    There is a tool called JProbe that seems to be the best profiling tool for
    java. As far as I know it can tell exactly where your memory leaks happen
    Alex.


    >Is it possible to have java check to see how much memory a particular
    >program is chewing? Preferably every second.
    >
    >
    >The program whose memory needs to be checked is a windows NT based program
    >suspected to have a memeory leak!!
    >
    >
    >A speedy reply would be appreciated
    >
    >
    >Cheers Charlie



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center