Reading system and JVM memory ?

How would one get started in locating the current system memory use and current memory use of the JVM running the java application.
Primarily for windows but I would prefer platform independant.

I found how to get the current JVM Memory, but I still dont know how to find current system memory usage ?

Similar Messages

  • Passing memory between native and JVm withought copying?

    Hi there,
    I know that its possible with NIO to access "native" memory from java withought copying the whole data into heap.
    However does anybody know a small tutorial or just a piece of code that shows how to do this, both on the native and on the java-side?
    Thank you in advance, lg Clemens

    Here is a very simple example, built on Windows XP Pro with Cygwin's gcc:
    // ReadDirect.java:
    import java.nio.*;
    public class ReadDirect
        static
            System.loadLibrary("ReadDirect");
        public static void main(String[] args)
        throws Exception
            ByteBuffer buffer = getDirectBuffer();
            buffer.order(ByteOrder.LITTLE_ENDIAN);
            long nbr1 = buffer.getLong();
            System.out.println("nbr1 = " + nbr1);
            double nbr2 = buffer.getDouble();
            System.out.println("nbr2 = " + nbr2);
            byte[] bArray = new byte[16];
            buffer.get(bArray);
            System.out.println("str = " + new String(bArray));
        private static native ByteBuffer getDirectBuffer();
    // ReadDirect.h:
    #ifndef _Included_ReadDirect
    #define _Included_ReadDirect
    #include <jni.h>
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     ReadDirect
    * Method:    getDirectBuffer
    * Signature: ()Ljava/nio/ByteBuffer;
    JNIEXPORT jobject JNICALL Java_ReadDirect_getDirectBuffer(JNIEnv * env, jclass cls);
    #ifdef __cplusplus
    #endif
    #endif /* !_Included_ReadDirect */
    // ReadDirect.cpp:
    #include <string.h>
    #include "ReadDirect.h"
    typedef struct MyStruct_tag
        long long   nbr1;
        double      nbr2;
        char        str[16];
    } MyStruct;
    MyStruct myStruct; // <-- This is the memory that will be read from the JVM.
    * Class:     ReadDirect
    * Method:    getDirectBuffer
    * Signature: ()Ljava/nio/ByteBuffer;
    JNIEXPORT jobject JNICALL Java_ReadDirect_getDirectBuffer(JNIEnv * env, jclass cls)
        myStruct.nbr1 = 1234L;
        myStruct.nbr2 = 5.6;
        memset(myStruct.str, 0, sizeof(myStruct.str));
        strcpy(myStruct.str, "Hello World!");
        return env->NewDirectByteBuffer(&myStruct, sizeof(myStruct));
    // build.sh:
    #!/bin/sh
    JAVA_HOME=/programs/j2sdk1.4
    LIBRARY_MODULE=ReadDirect
    javac $LIBRARY_MODULE.java
    g++ -mno-cygwin -D__int64="long long" -I $JAVA_HOME/include/win32 -I $JAVA_HOME/include -shared -Wl,--kill-at -o $LIBRARY_MODULE.dll $LIBRARY_MODULE.cpp
    // Output:
    java ReadDirectnbr1 = 1234
    nbr2 = 5.6
    str = Hello World!

  • MBP "System Profile" error when try read "Logs" and long time blue screen

    MBP "System Profile" error when try to read "Logs" and it takes long time blue screen at startup.
    This happened all time when I open the "System Profiler" application and then select the option "Log", then the system crashed again over and over. The system was reinstalled clean but the error occurs again, without any third party application installed.
    Here is the error:
    Sun Jun 22 20:13:47 2008
    panic(cpu 0 caller 0x001A8CD4): Kernel trap at 0x007efc12, type 14=page fault, registers:
    CR0: 0x80010033, CR2: 0x00000000, CR3: 0x013ab000, CR4: 0x00000660
    EAX: 0x00000000, EBX: 0x045ce1e0, ECX: 0x05782c64, EDX: 0x00010001
    CR2: 0x00000000, EBP: 0x344d3ca8, ESI: 0x046ad5c0, EDI: 0x046a8040
    EFL: 0x00010206, EIP: 0x007efc12, CS: 0x00000008, DS: 0x00010010
    Error code: 0x00000000
    Backtrace, Format - Frame : Return Address (4 potential args on stack)
    0x344d3ab8 : 0x12b0fa (0x459294 0x344d3aec 0x133243 0x0)
    0x344d3b08 : 0x1a8cd4 (0x4627fc 0x7efc12 0xe 0x461fac)
    0x344d3be8 : 0x19ede5 (0x344d3c00 0x206 0x344d3ca8 0x7efc12)
    0x344d3bf8 : 0x7efc12 (0xe 0x48 0x10 0x3e0010)
    0x344d3ca8 : 0x3ef261 (0x45ce1e0 0x46a2c40 0x49a7a4 0x0)
    0x344d3ce8 : 0x40abe6 (0x46a8040 0x46a2c40 0x344d3d28 0x3eeac0)
    0x344d3d08 : 0x40e4fb (0x46aec00 0x46a2c40 0x46aec04 0x46aec00)
    0x344d3d28 : 0x43ab14 (0x46aec00 0x46a2c40 0x600000 0x19c8d1)
    0x344d3d78 : 0x18801e (0x46aec00 0x4a5e5ac 0x4a5e5c0 0x11d975)
    0x344d3db8 : 0x12d17e (0x450adac 0x4a5e590 0x0 0x0)
    0x344d3df8 : 0x126257 (0x450ad00 0x0 0x18 0x344d3ee4)
    0x344d3f08 : 0x1973dd (0x344d3f44 0x0 0x0 0x0)
    0x344d3fc8 : 0x19f3b3 (0x479fee0 0x0 0x10 0x0)
    No mapping exists for frame pointer
    Backtrace terminated-invalid frame pointer 0xbffff1c8
    Kernel loadable modules in backtrace (with dependencies):
    com.apple.iokit.IOFireWireIP(1.7.1)@0x7ea000->0x7f2fff
    dependency: com.apple.iokit.IOFireWireFamily(3.4.4)@0x6ed000
    dependency: com.apple.iokit.IONetworkingFamily(1.6.0)@0x5d1000
    BSD process name corresponding to current thread: ioreg
    Mac OS version:
    9D34
    Kernel version:
    Darwin Kernel Version 9.3.0: Fri May 23 00:49:16 PDT 2008; root:xnu-1228.5.18~1/RELEASE_I386
    System model name: MacBookPro3,1 (Mac-F4238BC8)
    This is the System Config:
    Model: MacBookPro3,1, BootROM MBP31.0070.B07, 2 processors, Intel Core 2 Duo, 2.4 GHz, 2 GB
    Graphics: GeForce 8600M GT, GeForce 8600M GT, spdisplayspciedevice, 256 MB
    Memory Module: BANK 0/DIMM0, 1 GB, DDR2 SDRAM, 667 MHz
    Memory Module: BANK 1/DIMM1, 1 GB, DDR2 SDRAM, 667 MHz
    AirPort: spairportwireless_card_type_airportextreme (0x168C, 0x87), 1.3.5
    Bluetooth: Version 2.1.0f17, 2 service, 1 devices, 1 incoming serial ports
    Network Service: Ethernet, Ethernet, en0
    PCI Card: pci168c,24, sppci_othernetwork, PCI Slot 5
    Serial ATA Device: FUJITSU MHW2160BHPL, 149.05 GB
    Parallel ATA Device: HL-DT-ST DVDRW GSA-S10N
    USB Device: Built-in iSight, Apple Inc., high_speed, 500 mA
    USB Device: Bluetooth USB Host Controller, Apple, Inc., full_speed, 500 mA
    USB Device: Apple Internal Keyboard / Trackpad, Apple Computer, full_speed, 500 mA
    USB Device: IR Receiver, Apple Computer, Inc., low_speed, 500 mA

    Hello @larrycarol99,
    I understand that after upgrading your computer when you plug in an ethernet cord you get a hardware malfunction error. I am providing you with a Microsoft Support document: Hardware Malfunction Results in System Error Message that explains what causes that error and provides steps on fixing it. I am also including a link to the Compaq Presario 5300US Desktop PC Drivers page, which unfortunately does not have any drivers for your computer running Windows Vista.
    I hope this helps. Thank you for posting on the HP Forums. Have a great day!
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    Dunidar
    I work on behalf of HP
    Find out a bit more about me by checking out my profile!
    "Customers don’t expect you to be perfect. They do expect you to fix things when they go wrong." ~ Donald Porter

  • How to read system memory size, processor speed of a system

    Hi all,
    How to read system memory size, processor speed of a system and how to read how much of it are in use in a running system. (using java)
    any help would be great.
    -thanks

    How to read system memory size, processor speed of a
    system and how to read how much of it are in use in a
    running system. (using java)Using Java: not at all. You'll need JNI.

  • MAS and  Attempted to read or write protected memory.

    I'm experiencing an unusual system error using Mobile Application Studio enviroment (CRM Release 2007 / 5.0 SP 09).  As soon as I run the MAS, open a Change List and say edit a tile, tileset etc... the application crashes and the system displays a dialog box with the error message:
    "Attempted to read or write protected memory. This is often an indication that other memory is corrupt".
    How can i resolve this issue in our mobile application studio?
    Thanks in advance
    Eddie

    Hello Eddie
    The mentioned error is generic and could be because of several reasons.
    If you try to edit any BOL Object designers or Code windows from MAS Startup Page/Find Results window throws an error u201CAttempted to Read or write protected memory. This is often an indication that other memory is corrupt", So it is always recommended to expand the Business Library node manually after opening the MAS and continue with other Modeling/Development tasks.
    But if you are not modifying or editing any of the BOL objects, then it must be becuase of some other reason. In such case, can you please provide more detailed steps for the crash to occur.
    Best Regards
    Shankar

  • What is the latest operating system that I can install on my macmini 1,1?  it has an intel core duo and 2gb memory.

    what is the latest operating system that I can install on my mac mini 1,1?  it has an intel core duo and 2gb memory. Current osx is 10.4.11.

    Mac OS X 10.6.8.
    (63055)

  • Running a mid 2009 iMac on 10.7.5, 3 gb memory, 320 gb hd.    Suddenly the computer stoped reading DVDs and the only time I can read a CD is if I restart.  Quite often when I insert a CD it gets stuck and I cannot get it out until I restart and it shows u

    Running a mid 2009 iMac on 10.7.5, 3 gb memory, 320 gb hd. 
    Suddenly the computer stoped reading DVDs and the only time I can read a CD is if I restart.  Quite often when I insert a CD it gets stuck and I cannot get it out until I restart and it shows up on the desktop where I can then eject it.
    I have checked and double checked the finder prefs and all looks normal showing a check mark on CDs,DVDs etc. (the ones I want to show up on the desktop)
    I have reset the PEAM, repaired permissions with both the disk utility on the computer and the disk utility when I start up in the Recovery Disk.  I did notice that sometimes the permission repeat the same correction several times before it moves on, and sometimes it doesn’t. I have Windows installed on a partition but I keep it unmounted until it is needed for my wife’s work.  The dock seems to be just fine and all the apps seems to run just fine.  When I insert a photo CD iPhoto does not open but when I insert a music CD iTunes does open. 
    Also, most every time I open iPhoto it takes a long time(sometimes as long as 2 minutes) for it to load.
    Sometimes my Mail (Mail 5.3) does not post new mail but most of the time it does. 
    Once and a while it seems like the computer slows way down but then it seems ok ten minutes later.
    All  of these ‘things’ seemed to have happen suddenly and I have not downloaded anything from the internet in some time.
    Of course the warranty and extended warranty are both no longer in effect having had this computer for more than three years.
    I am running Java and Adobe Player because some of the sites I go to a lot require both.

    I believe that insufficient RAM may be the source of some of your problems. If you have a RAM of somewhere 4 to 8GB, you will experience smoother computing. 3GB doesn't seem right, so you might want to learn more by going to this site:
    http://www.crucial.com/store/drammemory.aspx
    I don't know what know what's happening with your optical drive, but it seems you use your drive quite a bit. In that case, look into a lens cleaner for your machine. It's inexpensive, works quite well.
    I hope you'll post here with your results!

  • I am using your software: CS^ InDesign Suite on a PC using a Windows 7 operating system.     Due to eyesight issues, I need to have the menu bars of programs in easy-to-read font and picture size.  Specifically, the menu bar

    Hi,
    I am using your software: CS6 InDesign Suiteon a PC using a Windows 7 operating system.
    Due to eyesight issues, I need to have the menu bars of programs in easy-to-read font and picture size.  Specifically, the menu bar across the top (File, Edit, View, etc.), and the menu bar on the left side with the graphic depiction of options.
    In earlier versions of Windows (e.g. XP), whenever I changed the screen resolution on my computer to a lesser resolution in order to show the link icons on my desktop in a larger, more readable size, all the software programs, including yours, appeared on my screen with the menu bars in the larger font size that I needed.
    However, in Windows 7, this is not the case.  Even though I have selected the lowest resolution, making the icons on my desktop extremely large, I cannot read the options across the top menu bar of your program, nor the pull-down menu items that they contain.  I cannot see the graphic depictions of options on the left side of the screen. They are all too small.  How can I make your program increase the size?

    CS6 is not high-DPI compatible/ enabled and that can't be changed. If you cannot6 make it work with your operating system means, then short of joining Creative Cloud and using newer versions there is nothing you can do.
    Mylenium

  • I am using CS6 InDesign suite on a PC using a Windows 7 operating system.     Due to eyesight issues, I need to have the menu bars of programs in easy-to-read font and picture size.  Specifically, the menu bar across the top (File, Edit, View, etc.), and

    I am using CS6 InDesign on a PC using a Windows 7 operating system.
    Due to eyesight issues, I need to have the menu bars of programs in easy-to-read font and picture size.  Specifically, the menu bar across the top (File, Edit, View, etc.), and the menu bar on the left side with the graphic depiction of options.
    In earlier versions of Windows (e.g. XP), whenever I changed the screen resolution on my computer to a lesser resolution in order to show the link icons on my desktop in a larger, more readable size, all the software programs, including yours, appeared on my screen with the menu bars in the larger font size that I needed.
    However, in Windows 7, this is not the case.  Even though I have selected the lowest resolution, making the icons on my desktop extremely large, I cannot read the options across the top menu bar of your program, nor the pull-down menu items that they contain.  I cannot see the graphic depictions of options on the left side of the screen. They are all too small.  How can I make your program increase the size?

    NO way.
    Mylenium

  • VI to read CPU and Memory usage on XP machines

    Need a VI to read CPU and Memory usage on an XP machine.

    it works perfectly on my LV8.0 and W2K... it should work on XP too... happy coding...
    Message Edited by JQ on 01-12-2007 11:14 AM
    Best Regards,
    JQ
    LV 8.0 user...
    Attachments:
    cpu_usage.vi ‏18 KB

  • I have a windows 7 system and use Adobe Reader XI, 11.0.05  All my excel spreadsheet files have conv

    I have a windows 7 system and use Adobe Reader XI, 11.0.05  All my excel spreadsheet files have converted to Adobe files and I cannot access my excel spreadsheets.  I uninstalled Adobe and reinstalled the version all over, and I also downloaded a security patch, however, I am still having the same problem.  Does anyone know what is causing this to happen and what I might be able to do to fix this ?  Thank you

    I don't understand; did you really convert all your Excel docs to PDF (how?), or did you merely lose/change the file association?
    If the latter, that's really easy: http://windows.microsoft.com/is-is/windows7/change-the-program-that-opens-a-type-of-file

  • Dm4-1060us laptop SD Card Reader 5-in-1 question. Does it work with SDHC and SDXC memory cards?

    dm4-1060us laptop SD Card Reader 5-in-1 question. Does it work with SDHC and SDXC memory cards?

    This cart reader is a kind of multi card reader and you can use different cards with it. In my opinion every multi device should be used very, but very gently. I do not know what happened exactly in your case but maybe you have damaged something inside.
    Try to restart your notebook and use other SD card to check if everything works well. Please do it very gently and if you see something is wrong stop with inserting the card.
    I use 1 GB SD card on my A200 without any problems.
    In my opinion you should check notebook by technician.
    Bye and good luck!

  • I have windows xp serv pack 2 (32 bit ) system and i cant install adobe reader 9.5 error 150105

    Ihave windows xp serv pack 2 (32bit) system and i am unable to install adobe reader 9.5 for my system . The file is downloaded completely but when the installation begins , it shows Error 150105 , " this version of windows is not supported for installation " . Pls  help .

    Hmm,
    I checked self-extractor (Exe version from the link below) and it has proper OS and RAM levels set in the configuration file - no SP
    I would advise to try MSI version from the link below:
    ftp://ftp.adobe.com/pub/adobe/reader/win/9.x/9.5.0/en_US/

  • When i use firefox my system automatically closes and dumping memory starts

    when i use firefox my system automatically closes and dumping memory starts. This problem is not with interner explorer nor with google crome

    Firefox sometimes uses more memory (RAM) than it should. This can make Firefox slower, and in extreme cases, it can even make Firefox crash. This article describes how to make Firefox use less memory.
    https://support.mozilla.org/en-US/kb/firefox-uses-too-much-memory-ram

  • I have an iMac OS X ver 10.7.5.  Processor speed is 3.06 GHz intel core i3, and the memory is 4 GB 1333 MHz RAM.  My online banking app is being updated and requires OS ver 10.8 or newer.  When I ask for available updates, the system says there are n

    I have an iMac OS X ver 10.7.5.  Processor speed is 3.06 GHz intel core i3, and the memory is 4 GB 1333 MHz RAM.  My online banking app is being updated and requires OS ver 10.8 or newer.  When I ask for available updates, the system says there are none available.  How can I update my system to ver 10.8 or newer to accommodate the new banking app?

    You can update directly to Yosemite (for free) through the App Store (this is 10.10). Make sure your existing applications will run on this OS.
    If you wish to stay at 10.8, you can order this through the online Apple Store (it's $20), and they will email you a redemption code to be used on the App Store.
    http://store.apple.com/us/product/D6377Z/A/os-x-mountain-lion
    Matt

Maybe you are looking for

  • ITunes prompting me for an old ID and password to play purchases made with my new account

    I have been purchasing music with my current ID since 2007. I have recently noticed though that some music bought with this account will no longer play unless I give a password for an old account (pre-2007). Luckily I have receipts so can prove which

  • SG300-20 configure 1 ip pr port

    We got 1 customer that would like us to configure a system based on SG300-20 linked up with an SG300-10SFP using trafficshaping ingress and egress limited to 40mbit. This part of the case is solved using ingress/egress 40960 with an burtlimit a bith

  • ACE with sticky http-cookies across two server farms issue

    Hi, /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt

  • Free upgrade to CS6 from CS5.5?

    I purchased CS5.5 in May. I understand there is a free upgrade to CS6 due to purchase date. How do I get it?

  • Archive mode

    After I execute Begin Archive command for a cube...can I change any database properties??? I tried adding comments and it gets updated?? What are the type of changes which it will not accept when the cube is in archive mode.. Data updations should no