Java, the memory hog......

hi all,
i have an application that is kb's in size but takes 70 mb of memory when it runs. the application is just a basic swing application that has nothing special. i am developing on an sgi irix system. could someone brake down what swing components takes the most memory. does anyone know of a good memory debugger for java. how would i run down what is taking so much memory. any insight into this problem would be much appreciated.

I was making a simple application of a similar description.
I found my problems were my use of Strings .
within tight loops I set the string's variable to null at the end .
I set all strings and objects to null after they are used so that they could be picked up by java's garbage collector.
I noticed no more memory problems.

Similar Messages

  • Yosemite the memory hog

    I installed Yosemite today, and I love it! However I went into the activity monitor and found out that I was using 7.96gb! Is this a common bug? How can I fix it?

    It's not a bug. Yosemite like Mavericks takes over as much RAM as possible to make it easier to manage memory allocations. it's quite normal.

  • Weblogic java process slowly hogging memory

    My unix 'top' utility tells me that my Weblogic java process is slowly
    hogging memory, over a period of hours under heavy load, until the machine
    finally starts swapping and performance goes into the toilet.
    I got a copy of jprobe, which I had hoped would show me that I have memory
    leaks, but it said everything was fine, I could see the little graph of heap
    memory getting sent back down to 10 Meg every minute or so. Then I bring up
    'top' with no jprobe, and I watch "SIZE" grow to 250 Meg and I run out of
    virtual memory. Anybody know what is up?
    System info: Weblogic Server 5.1, sp5, Solaris 2.7, JDK 1.2.2_07.
    Thanks in Advance
    Greg

    250M for WLS is not very much. How much physical memory is on
    the machine? What do you have your heap size set to?
    Use the command /usr/proc/bin/pmap to dump out the memory
    segments of the JVM. You will find one of the segments labeled
    'heap' this is not the Java Heap, this is the C heap. Does it
    grow? If it does, do you have native code (type 2 db drivers)or
    any other native code? The JVM also uses the C heap. Compiling
    JSPs seems to use a lot of memory. JSPs compiled with SP9 will
    use less C heap than pre-SP9.
    There will be another 'anon' segement that corresponds to the
    size of the max Java Heap as shown by the weblogic console.
    The 'Total' should correspond to the 'size' you see in top.
    Mike
    "Greg Lems" <[email protected]> wrote:
    My unix 'top' utility tells me that my Weblogic java process is slowly
    hogging memory, over a period of hours under heavy load, until the machine
    finally starts swapping and performance goes into the toilet.
    I got a copy of jprobe, which I had hoped would show me that I have memory
    leaks, but it said everything was fine, I could see the little graph
    of heap
    memory getting sent back down to 10 Meg every minute or so. Then I bring
    up
    'top' with no jprobe, and I watch "SIZE" grow to 250 Meg and I run
    out of
    virtual memory. Anybody know what is up?
    System info: Weblogic Server 5.1, sp5, Solaris 2.7, JDK 1.2.2_07.
    Thanks in Advance
    Greg

  • How to check the Memory consumtions and time taken by a Java Program??

    HI all,
    I want to know how to check for the Memory Usage of an XML Parser.
    See, a product was developed completely in DOM parser and now I am replacing that thing with SAX Parser Completely, because the DOM parser was taking huge memory as u may have guessed.
    BUt the thig is that, now I want to check how much memory is being taken by the SAX parser alone and DOM parser alone so that I can compare them.
    Can anyone suggest me how to do that ???
    Thanx in Advance
    Kaushik

    Thanx boss ..thanx a lot
    I tried that, but in the API docs, it is mentioned that freeMemory()Returns the amount of free memory "in the system"
    and totalMemory() Returns the total amount of memory in the "Java Virtual Machine".
    So if I compare both the Values then would it give the Correct result to me ???? Beacuse the freeMemory() gives the data in terms of the Host System whereas totalMemory() provides the data in terms of Java Virtual Machine ..... are they Same ?????
    I think I am clear in explaining what exactly is going on my mind ...
    Please clarify
    Thanx again
    Kaushik

  • How can I get the memory allocation info of a java thread?

    Now I am going to write a program to monitor the execution condition of the java threads. But it seems that the classes in standard edition of JDK does not provide facilities to get the information such as the memory allocation and CPU time of a running thread. How can I do with it? Can I use JNI or JVMDI to get them? If it could do, how?

    Thanks a lot. I just browsed the specification of jvmpi. It is interesting and it seems that I can get the information I need. However, if I want to get the information in my program, I mean, if I want to build a class which may use JNI method to invoke the function written with JVMPI, and then forward the data to other upper layer objects, can it be done?

  • Agent issue:Oracle keeps proposing enlarging the memory of the java stack

    Hi,
    Our PROD agent suddenly started not responding . The package showing execution in monitor without showing what code it is executing. This continuously exeecuting package then we had to set to error and then we went with execution with Local(no agent) which got executed successfuly in prod but still having issues with PROD agent.
    Oracle proposed the sol- "Oracle keeps proposing enlarging the memory of the java stack " The sol worked for few days and again facing the same issue. One of the
    query raised by oracle is
    "Ask the developers if they are using standard transaction processing knowledge modules and if they have considered using BULK loading type knowledge modules ? Please
    ask them for the precise name of the Knowledge Modules used and if they have been customized or not"
    How to identify this in detail? Any clue . We are using the standard KM and havent customized any KM
    With Thanks,
    Shilpa Dhote

    The question is what Knowledge modules are you using? Some use Bulk type processing, others transaction based. You can list knowledge modules by interface using a SQL query like this one :
    http://odiexperts.com/kms-in-each-interface

  • Is it possible to know the memory location of a variable in java

    Hai all,
    i want to know the memory location in which a particular variable is stored. is it possible to know in java.

    I just wanted to test the internal processing of the
    string variable when we want to change the value of a
    string variable. i heard that the variable will point
    to a new reference once we change the value of a
    string variable. so to test it out i want to know the
    memory location of a variable before and after
    changing a string variable.You can use the operator == to perform similar tests.
    String a;
    String b = a ="hello";
    a += "world";
    if(a==b)
         System.out.println("They are the same object");
    else
         System.out.println("A new object was created.");
    }

  • MacBook Pro with Yosemite 10.10.4 running hot and slow. HP file is hogging all the memory

    My MacBook Pro (late 2011, core i-7) running OS X 10.10.4 is running hot and very slow with the fan screaming .  Activity Monitor shows a process called com.hp.devicemodel.TransportProxy is hogging almost all the memory and very high CPU activity.  How can I get it to stop.  Force quit will not shut it down.  I would delete the file, but don't know where it is.  Can someone please offer some help? Thanks, Tom

    Try to uninstall all HP software (should be in Macintosh HD/Applications/HP folder  It should have an uninstaller within that folder.  My computer settled down just as soon as I finished the uninstall.  Went back into the system preferences and reinstalled my printer and everything seems OK now.  Hope it works for you.

  • Is it possible to create the memory for a Java object in C/C++?

    Is it possible to have a C/C++ program allocate some memory, then have JNI use that memory for primitive java objects (such an array of bytes) that are passed to Java objects ?
    I would like to allocate a region of memory in C++, then give that memory to a Java object (via some kind of JNI type) and have that Java object fill the memory region with data.
    My impression from reading the JNI API and the few examples I've looked at is "No", there is a strict boundary between C++ and JNI as regards memory management. There may be serious implications as to why what I'm suggesting is not feasible, I am not enough of a JNI expert to know yet, and would greatly appreciate any input/comment.
    Many thanks,
    Colm.

    No, you cannot. However, writing your JNI code you should not use memory of Local Heap (if it possible). Because Local Heap Memory used also by JVM. I have developed tools that generate C++ wrappers for JNI code. In these wrappers I use mainly Global/Virtual Memory. I also reduce to minimum creation of local/global references, as it is affects to JVM memory use. If you are writing JNI code under MS Windows then you can try my tools that automate JNI code writing:
    http://simtel.net/product.php[id]93174[SiteID]simtel.net
    http://simtel.net/product.php[id]94368[SiteID]simtel.net
    Now I am developing this tool for .Net. In two weeks it will be finished.

  • Java.exe - Application error. The instruction at "0x504c42b8" referenced memory at "0x00000009".The memory cannot be "read".

    Our production application is experiencing the following error with increasing
    frequency.
    Windows 2000 Dialog Box:
    java.exe - Application error.
    The instruction at "0x504c42b8" referenced memory at "0x00000009".The memory cannot
    be "read".
    Click on OK to terminate program.
    Does anybody know the cause and solution to this problem?
    We're using WL 5.1.0 sp11 jvm version 1.2.2_007
    However, searching the web indicates the error message occurs with a variety of
    configurations.
    [javaError.gif]

    John Slaman wrote:
    >
    Our production application is experiencing the following error with
    increasing frequency.
    Windows 2000 Dialog Box:
    java.exe - Application error.
    The instruction at "0x504c42b8" referenced memory at "0x00000009".The
    memory cannot be "read".
    Click on OK to terminate program.
    Does anybody know the cause and solution to this problem?
    We're using WL 5.1.0 sp11 jvm version 1.2.2_007
    However, searching the web indicates the error message occurs with a
    variety of configurations.I believe this is a memory flaws problem, cannot read memory can be in 2
    ways: either the address has been allocated (reserved) by some other
    resources or the address specified is not valid (phantom lookup).
    Try to get a higher version of WLS.
    Thanks,
    Neo Gigs
    "Follow the white rabbit..."

  • Is there a way to define the ideal size of the java heap memory?

    Hello all!
    Is there a way to define the ideal size the java heap memory? I'm using a server with (IR,FR,WA) installed and i'm using the Windows Server 2008 R2 with 32GB of ram memory. I have other server with the same configuration using essbase. How can i set the heap memory? I have around 250 users (not simultaneous).
    Regards,
    Rafael Melo
    Edited by: Rafael Melo on Aug 17, 2012 5:40 AM

    For 2008 which is 64 bit you can have
    For FR in windows registry
    HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Reports\HyS9FRReport
    Xms and Xmx can have 1536 each.
    For workspace
    Start “Start Workspace Agent UI” service and open Configuration Management
    Console (CMC) via http://localhost:55000/cmc/index.jsp
    for
    Workspace Agent / Common Services Java Heap size you can have
    Xms and Xmx as 1024 each.

  • Java.exe application error - the memory could not be read

    Hi all,
    I have some problems. I have been getting this error:
    The instruction at "0x03491c33" referenced memory at "0x034c1f77". The memory could not be "read".
    This error occurs when the disconnect function() is called.
    My code is as follows:
    JNIEXPORT void JNICALL Java_JFrame_disconnect (JNIEnv * env, jobject obj) {
    ::CoInitialize(NULL);
    HINSTANCE getprocDLL = LoadLibrary(TEXT("test.dll"));
    if (getprocDLL != NULL){
    typedef void (_cdecl*pICFUNC)(void);
    pICFUNC disconnect;
    FARPROC getProcessID = (FARPROC)GetProcAddress(HMODULE(getprocDLL),"Disconnect");
    disconnect = pICFUNC (getProcessID);
    disconnect() <---- error occurs when this function is called
    FreeLibrary(getprocDLL);
    ::CoUninitialize();
    Any idea what could be the possible problem with the code?
    Any help / suggestions would be greatly appreciated! Thanks in advance!
    Edited by: dolphlam on Sep 4, 2008 12:41 AM

    1. Check what value getProcessID has.
    2. Verify that the signature of the method that you are casting it to is correct.
    3. Can you call disconnect without actually connecting to something?
    4. Move the code out of JNI entirely. Create a C/C++ executable and verify that the code works there first.

  • Possible to check  the memory allocation with out given new keyword in java

    hi sir !
    if it is possible to check the memory allocation. before given the NEW.. and after given the NEW....
    and plz suggest me..
    thanks

    If you can't read and understand the API docs, you have no use for the information.
    And most likely, you don't need this information anyway, even though you think you do.

  • How to increase the memory for my weblogic server in Jdeveloper 12.1.2.0.0 ?

    Hey everyone,
    So as my title says, i'm trying to increase the memory for my weblogic server in my windows 7 64 bit machine, with 8GB ram.
    The values appear to be: JAVA Memory arguments: -Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m
    I've done some search from this forum and i've added this to my jdev.conf:
    AddVMOption  -XX:MaxPermSize=1536M (in this one i've only changed the value)
    AddVMOption -Xmx1536M
    AddVMOption -Xms1536M
    And i've changed this: MEM_ARGS="-Xms1024m -Xmx1024m" in my startNodeManager.sh file
    I'm still getting the same line in my server but i need to change the values since i'm not getting the server to run my application very well (it gets stucked in loading my databases and graphs) and i think it will continue untill i get a heap exception error.
    Any ideas of how to change this?
    Regards,
    Frederico.

    Thanks Alejandro .
    I'm going to ask you another question and this one is quite important.
    Whenever i run my project a couple of times, i'm not able to retrieve the page, it just gets stuck on loading.
    It just stops the loading, like its a really really slow page. I'm not using a lot of rows in my database so i don't take to much memory but it doesn't load and i know everything is fine but i just added some graphs after testing it.
    Do you know why?
    In the console it says that everything is fine and shows the link for the page but it never loads completely until it gives a error because it does not respond in 600 seconds.
    Strange right?

  • Why on close am I geting " firefox.exe -Application error - The memory could not be "written" "?

    Why on close am I geting " firefox.exe -Application error "The instruction at "0x00000000" reference menory at "0x00000000". The memory could not be "written" Click OK to terminate."?
    This is on Window XP
    A program White Smoke was loaded into this unit about 3 month ago and a popup to buy started appearing 1 week ago. I unistalled the program and i found virus that was removed.
    The unit will not allow a system restore also.

    You do not need to start Firefox to disable the Java Quick Starter, you can do that via the Java Control Panel (Control Panel > Java > Advanced)
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

Maybe you are looking for