Results 1 to 3 of 3
  1. #1
    newms86 is offline Member
    Join Date
    Jul 2008
    Rep Power

    Default Read Process Memory

    Is there a way to read the memory of a process running on the system in java? In c++ there is a readProcessMemory() from the Windows API already built in.

    I am new to this. Is there a way to implement the Windows API in java or does java have something similar built in? Anything along the lines of the Robot class or something?

    any advice is welcome. thanks!

    I am using eclipse 3.3.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    I don't think java by itself can look in memory. Maybe with JNI
    Why would you need to do that?
    Java is supposed to be independent of OS, so would not have the Windows(as in MS) API. It has its own GUI API.
    Java has a Robot class.

  3. #3
    jmHoekst is offline Member
    Join Date
    Jun 2008
    Rep Power


    I had this issue just a couple weeks ago, and I ended up writing a small VB script that returns the memory of a process i specify to it. I have never written in VBscript before, so the code i got was hacked pieces of what I found on the internet. I actually ended up just writing the mem value to a .txt file and had my java program just read that .txt file. This might be a way for you to look into.

    I'm not a Robot expert, but I don't think the Robot is going to help you very much here. It does have a waitForIdle method, but I'm not sure if that will help you. The robot is more applicable to simulating keyboard strokes, mouse movements, and delays.

Similar Threads

  1. inter process communication
    By ibtehal in forum Networking
    Replies: 5
    Last Post: 06-23-2008, 01:35 AM
  2. i need help in http process
    By sureshjava in forum New To Java
    Replies: 0
    Last Post: 01-29-2008, 04:56 AM
  3. How can I set a time out on the loading process
    By paul in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 04:54 AM
  4. Replies: 1
    Last Post: 08-03-2007, 06:17 PM
  5. how to read memory addresses
    By fred in forum New To Java
    Replies: 1
    Last Post: 07-24-2007, 01:59 AM

Posting Permissions

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