How to detect Memory Leaking Problem in Java

I have a Java multithreading program & I suspect that there is a memory leaking issue in the program. Can someone tell me how can I know how to detect where is the memory leakage in the program?
I have download a few tools like hat, jprobe, optimizeit but not sure how to use it. I am using jdk1.3.0 in HP-UX
Thks

Not so true, you could have a memory leak if you accidental hold on to a resource, or maybe you have threads running that you have no reference to, and those threads hold some resources.
Optimizeit is pretty easy to use. You start you application with Optimize it, so Optimizeit is you JVM so to speak. In optimizeit you can get a list of active objects. If this list grows and grows, you probably have a problem. Let it run for a while, and see which objects are the most present, dubble-click it, and it lets you step down into you methods. This way you can maybe find you leak.
Good luck :)

Similar Messages

  • How to detect memory leak ????

    I have an app that runs monitors system.
    I tested it on the Win 2000 Pro, no prob it takes 8MB top
    Once I moved it to Win 2000 Server the ram usage grows constantly, it is over 30 mb now
    WHY?
    Are there any issues with 2000 server?
    HOw to debug it?
    I try JProbe , ran app for 2 hours with Profiler and it does not go over 8 MB heap???
    Thank you.

    JVMs are the same.
    How do you limit the heap???
    JProbe did not fina anything but after a few hours I
    got out of vertual memory error. Java took 300MB I
    asumed it was because of JProbe.
    Thnks Yarik.To limit the Java heap, you specify these paramaters
    java -Xmx8m YourClassNameHere
    However, given that you ran out of virtual memory, it sounds to me that something else is going on outside the Java heap. The heap limit, by default, is only 64MB, so that can't be it.
    What version of Java are you using (use "java -version" to find out for sure).
    Chuck

  • How can I avoid memory leak problem ?

    I use Jdev 10.1.2 . I have a memory leak problem with ADF .
    My application is very large . We have at least 30 application module , each application module contain many view object
    and I have to support a lot of concurrent users .
    as I know ADF stored data of view object in http session .
    and http session live is quite long . when I use application for a while It raise Ouf of Memory error .
    I am new for ADF.
    I try to use clearCache() on view object when I don't use it any more .
    and call resetState() when I don't use Application Module any more
    I don't know much about behavior of clearCache() and resetState() .
    I am not sure that It can avoid memory leak or not .
    Do you have suggestion to avoid this problem ?

    ADF does not store data in the HTTP session.
    See Chapter 28 "Application Module State Management" in the ADF Developer's Guide for Forms/4GL Developers on the ADF Learning Center at http://download-uk.oracle.com/docs/html/B25947_01/toc.htm for more information.
    See Chapter 29 "Understanding Application Module Pooling" to learn how you can tune the pooling parameters to control how many modules are used and how many modules "hang around" for what periods of time.

  • How do I report a major memory leak problem with Firefox 3.6.10 in WinXP?

    After I installed Firefox 3.6.9 on a WinXP desktop, I occasionally had minor memory leak problems, reflected by getting "out of virtual memory" messages. I upgraded to 3.6.10 when notified that it was available and that it supposedly fixed stability problems. Ever since then, whenever I use Firefox, it starts out quick as a flash, but very rapidly slows down to a crawl, and has twice brought my system to a halt. IE does not cause this, nor any other program I use, but the execution speed of all programs slows as badly as Firefox. If I knew where to get older versions, I would back up to 3.6.9 or earlier. The situation now prevents me from using Firefox much at all.

    Im running windows 7, Firefox 3.6.10 and before i updated to 3.6.10 my CPU never went above 10% with Firefox open. Now it can spike well above 50% and i have nothing different from when i had 3.6.9 to now when i have 3.6.10.
    There is no evidence for me to suggest one of the additions i have is causing it, its all pointing to Firefox itself and the last update.

  • Memory Leak Problem at Adobe LiveCycle Server 9.0

    Hi All,
    We want to upgrade our system to 9.0. During the performance test we have found memory Leak problem at ALS 9.0. I explain the detailed problematic issue below. Is there any body who has any suggest?
    We have Adobe Livecycle ES2 9.0 SP2 installed on WAS 6.1. But also WAS on Windows Server 2008 R2. We call java web services from .Net Web service for generating PDFs.
    On Java side “com/adobe/internal/pdftoolkit/services/javascript/GibsonMemoryTracking” class is causing Memory Leak problem at server.
    Our .Net Codes. I copied below. First we generate PDF then we convert this pdf to static pdf.
    First We call the GeneratePDF function.
    public static bool GeneratePdf(Document document, byte[] pdfTemplate)
            try
                //Create a FormDataIntegrationService object and set authentication values
                FormDataIntegrationService formDataIntegrationClient = new FormDataIntegrationService();
                formDataIntegrationClient.Credentials = new System.Net.NetworkCredential(Settings.ALCUserName, Settings.ALCPassword);
                //Import XDP XML data into an XFA PDF document
                ALCFormDataIntegrationService.BLOB inXMLData = new ALCFormDataIntegrationService.BLOB();
                //Populate the BLOB object
                inXMLData.binaryData = System.Text.Encoding.UTF8.GetBytes(document.XmlData);
                //Create a BLOB that represents the input PDF form
                ALCFormDataIntegrationService.BLOB inPDFForm = new ALCFormDataIntegrationService.BLOB();
                inPDFForm.binaryData = pdfTemplate;
                //Import data into the PDF form
                ALCFormDataIntegrationService.BLOB results = formDataIntegrationClient.importData(inPDFForm, inXMLData);
                document.PdfData = results.binaryData;
                Utility.Log("GeneratePdf", "Pdf generated successfully.", LogLevel.Info);
                return true;
            catch (Exception ex)
                document.ReturnCode = "22";
                document.ReturnMsg = "Exception on generating the pdf";
                Utility.Log("GeneratePdf", "Exception: " + ex.Message, LogLevel.Error);
                return false;
    Then We call the ConvertPDF function.
    public static bool ConvertPdf(Document document)
            try
                //Create a OutputServiceService object
                OutputServiceService outputClient = new OutputServiceService();
                outputClient.Credentials = new System.Net.NetworkCredential(Settings.ALCUserName, Settings.ALCPassword);
                //Create a BLOB object
                ALCOutputService.BLOB inData = new ALCOutputService.BLOB();
                //Populate the BLOB object
                inData.binaryData = document.PdfData;
                //Set rendering run-time options
                RenderOptionsSpec renderOptions = new RenderOptionsSpec();
                renderOptions.cacheEnabled = true;
                //Create a non-interactive PDF document
                ALCOutputService.BLOB results = outputClient.transformPDF(inData, TransformationFormat.PDF, PDFARevisionNumber.Revision_1, false, null, PDFAConformance.B, false);
                document.PdfData = results.binaryData;         
                Utility.Log("ConvertPdf", "Pdf converted successfully.", LogLevel.Info);
                return true;
            catch (Exception ex)
                document.ReturnCode = "22";
                document.ReturnMsg = "Exception on converting dynamic pdf to static pdf";
                Utility.Log("ConvertPdf", "Exception: " + ex.Message, LogLevel.Error);
                return false;
    Our System Configuration:
    Expiry date: Never Version: 9.0.0.0,
    GM Patch Version: SP2
    Service Pack Version: unknown
    ADOBE® LIVECYCLE® PDF Generator ES2
    9.0.0.0
    SP2
    ADOBE® LIVECYCLE® Reader Extensions ES2
    9.0.0.0
    SP2
    ADOBE® LIVECYCLE® Output ES2
    9.0.0.0
    SP2
    We changed some configuration which is suggested by Adobe. But this change does not solve our problem.
    Changed Configurations via ADMINUI
    Memory Leak Problem which is viewed via wily tool:

    Hi Mahir,
    Can you attach the results of this performance test where we can see how GibsonMemoryTracking class is causing the memory leak issue.
    Also do you see any stackTrace in the LiveCycle server logs related to memory / heap when you run this performance test ?
    Thanks,
    Simer

  • Memory leak problem while passing Object to stored procedure from C++ code

    Hi,
    I am facing memory leak problem while passing object to oracle stored procedure from C++ code.Here I am writing brief description of the code :
    1) created objects in oracle with the help of "create or replace type as objects"
    2) generated C++ classes corresponding to oracle objects with the help of OTT utility.
    3) Instantiating classes in C++ code and assigning values.
    4) calling oracle stored procedure and setting object in statement with the help of setObject function.
    5) deleted objects.
    this is all I am doing ,and getting memory leak , if you need the sample code then please write your e-mail id , so that I can attach files in reply.
    TIA
    Jagendra

    just to correct my previous reply , adding delete statement
    Hi,
    I am using oracle 10.2.0.1 and compiling the code with Sun Studio 11, following is the brief dicription of my code :
    1) create oracle object :
    create or replace type TEST_OBJECT as object
    ( field1 number(10),
    field2 number(10),
    field3 number(10) )
    2) create table :
    create table TEST_TABLE (
    f1 number(10),f2 number (10),f3 number (10))
    3) create procedure :
    CREATE OR REPLACE PROCEDURE testProc
    data IN test_object)
    IS
    BEGIN
    insert into TEST_TABLE( f1,f2,f3) values ( data.field1,data.field2,data.field3);
    commit;
    end;
    4) generate C++ classes along with map file for database object TEST_OBJECT by using Oracle OTT Utility
    5) C++ code :
    // include OTT generate files here and other required header files
    int main()
    int x = 0;
    int y = 0;
    int z =0;
    Environment *env = Environment::createEnvironment(Environment::DEFAULT);
    Connection* const pConn =
    env->createConnection"stmprf","stmprf","spwtrgt3nms");
    const string sqlStmt("BEGIN testProc(:1) END;");
    Statement * pStmt = pConn->createStatement(sqlStmt);
    while(1)
    TEST_OBJECT* pObj = new TEST_OBJECT();
    pObj->field1 = x++;
    pObj->field2 = y++;
    pObj->field3 = z++;
    pStmt->setObject(1,pObj);
    pStmt->executeUpdate();
    pConn->commit();
    delete pObj;
    }

  • Memory leak problems with loading videos over and over.

    I'm having memory leak problems with loading videos into a VideoPlayer aswell as FLVPlayback.
    What the flash should do:
    - Should be running for 7 days without having to restart the projector.
    - Interface that shows people around a 360 3D model with 5 different parts and at the stops it makes during the rotation you can click to zoom in on a location which plays a movie for that aswell.
    - Shows a video out of 5 parts for a 360 rotation in 3D in mp4 video (added each time and cleaned up, see code below).
    - Still images are used when the video clips are done playing (MovieClip in stage).
    - Should run automatically when there is no user interaction for X minutes.
    What the problem is:
    - The flash (as a exe and swf i guess) starts to consume memory over time (say 10 hours) until the projector crashes. This usually at around 1.75 GB of memory.
    I cannot see why the Flash cannot garbage collect this and free up the memory. Mabye there is something I don't understand about the garbage collection in flash?
    Here is some code from the video loading and playing:
    var fVideo:VideoPlayer;
    VideoCreate();
    function VideoReady(pEvent:VideoEvent):void
    trace("VideoReady()");
         // start playing video
    fVideo.play();
    function VideoLoad(pUrl:String):void
         trace("VideoLoad(" + pUrl +
         VideoCreate();
         if (pUrl != "")
              if (fVideoFolder + pUrl == fVideo.source)
                   fVideo.seek(0);
    VideoReady(null);
              } else {
    trace(fVideo.state);
                   if (fVideo.state !=
    VideoState.DISCONNECTED) fVideo.stop();
    fVideo.close();                                
    fVideo.load(fVideoFolder + pUrl);
         } else {
    // error no url
    function VideoCreate():void
         trace("VideoCreate()");
         // remove old one
         if (getChildAt(0) == fVideo)
              removeChildAt(0);
         fVideo = new
    VideoPlayer(1024, 768);
         addChildAt(fVideo, 0);
         fVideo.autoRewind = false;
    fVideo.addEventListener(VideoEvent.COMPLETE, VideoDonePlaying);
    fVideo.addEventListener(VideoEvent.READY, VideoReady);

    Hmm. It's in connection with Dropbox. Så apparantly you can only use one of the two at the same time if you want the programs integrated in Finder.

  • Is memory leak Problem Solved in this new FW 4.08...

    Hi frnds,This is my very first post. Im happy to be a member of N Series Family by owing a brand New N73 ME One Week Before (July 2008). The phone really Fascinated me with its features, Since my Previous Phone was Nokia 6630. Now let me Come to my problem.
    A "Memory Full. Close some application" Error is encountering me twice or thrice a day. if i knowledge is correct, its Low RAM error & i found my RAM in the range of 18-20MB just after startup & along with usage of applications & closing, it maintain a range b/w 4-8MB. In this time wen i open a picture in inbuilt PicEditor this Memory full Error occurs(And sometimes while zooming a picture in gallery also). Will updating to the new FW according to my product code 0543843 is 4.0812.4.2.1 will solve the Memory leak problem ? i have gone through all the post regarding the issues on latest firmware updates Good & Bad. So im a bit confused that shud i update or not. Coz i have only this memory problem. Everything else is fine.
    Please help me.
    N73 ME
    v 4.0736.3.2.1
    04-09-2007
    RM-133
    Code:0543843
    INDIA

    I have 4.0812.4.2.1 and I have the same problem..I think that in 4.0736 is best memory usage than other firmwares,but I can't downgrade firmware

  • Since the itunes 10.4.1 update  I have memory leaks problems.

    Since the itunes 10.4.1 update  I have memory leaks problems, Itunes used memory start at about 100 megs as usual but when it play the ram usage climb about 4 kb per second ( one time I had itunes using 690 megs !). I had to periodically close and restart Itunes to clear the memory.
    Someone has suggestion to resolve this problem?

    Same issue, Running Windows 7 x64 with 6 Gigs of RAM and have iTunes 10.4.1 32bit version.
    I wanted to break in some headphones over the weekend, so left it playing a loop of songs. Came back on Monday to see my machine using a huge amount of RAM and iTunes just froze.
    Here is a shot of my Task Manager showing iTunes was using 1.5gigs of Memory.

  • App-V 5.0 memory leak problem & slow program launch

    App-V 5 clients with most recent updates have a memory leak problem. Windows 7 64bit workstations with 8GB of memory will be useless within couple of days because memory has run out. Terminating App-V client process will free the memory, but system starts
    to consume it again after that. All hotfixes (up to 5) have been installed.
    Another problem is that launching some large (locally cached) programs, for example SolidWorks, takes many minutes for a program to start. With 4.6 there wasn't any performance issues.
    Any suggestions?

    I saw the exact same issue with slow load times and 50% utilization by AppVClient.exe during that time.
    AppV 5 first launch application performance
    AppV 5 - Measuring RegistryStaging load times
    The issue, specifically, is the amount of time the application takes to stage the registry is what causes the slow load and 50% CPU utilization.  I've written a script that stages the registry on your behalf that we use on server startup, after all
    the packages are loaded.
    Original Thread on MS forums:
    https://social.technet.microsoft.com/Forums/en-US/44944302-d8f3-4df1-b104-9c63345f88e0/poor-first-launch-performance-with-appv-5?forum=mdopappv

  • Memory leak problem, help!

    There is memory leak problem when select multi-rows table. Suppose that I don't make mistake when coding. Have U ever use Borland Delphi? In TQuery, there a field called UniDirectional when set it to True, selected rows aren't cached in Memory. So that There is must be a parameter in OCI does like UniDirectional does. There is any one know about it? reply this question or mail me directly at [email protected]
    Thank in advance.

    There is memory leak problem when select multi-rows table. Suppose that I don't make mistake when coding. Have U ever use Borland Delphi? In TQuery, there a field called UniDirectional when set it to True, selected rows aren't cached in Memory. So that There is must be a parameter in OCI does like UniDirectional does. There is any one know about it? reply this question or mail me directly at [email protected]
    Thank in advance.

  • How can i detect "Memory leak" with large LabVIEW projects.

    Hi,
    I have a huge LabVIEW application that runs out of memory after running continuously for some time. I am not able to find out the VI that is hogging up memory. Is there any tool that dynamically detects the VI that is leaking memory.
    Or, is there a tool or a way to identify the critical areas which can be potential culprits that is leaking memory.
    Regards
    Bharath

    Bdev wrote:
    Thanks Dennis.
    I think Desktop Execution toolkit should solve the problem. 
    Wayne Wrote
    Have you tried Tools»Profile»Performance and Memory ?  http://zone.ni.com/reference/en-XX/help/371361F-01/lvdialog/profile/
    But this will just give me the amount of memory used by the VIs and not the amount of memory that is not getting released.
    And where is the problem about that? Just try to find what VIs keep increasing in memory size. That are the culprits. If you have real memory leaks, meaning there is memory that is not managed by LabVIEW directly but for instance by a DLL somewhere and that DLL looses references to memory, so it goes really lost, then the only way to find that is by successively exclude functionality in your application until you can find the culprit.
    There is no other simple way to find out about who is loosing memory references than by doing debugging by exclusion until the problem disappears. The only way to speed this up, which quite often works for me is doing an educated guess, about what components are most likely to do this misbehaviour.
    Not knowing anything about your application and if you are talking about memory hogs (fairly easily identifiable by the mentioned Performance and Memory monitor) or actual memory leaks, it is hard to tell how to go about it. Memory hogs are usually the first thing I suspect escpecially with software I inherit somehow from people from whom I'm not sure they know all the ins and outs of LabVIEW programming.
    If a leak seems likely the first culprit usually are custom DLLs (yes even DLLs I have written myself), then NI DLLs such as DAQmx, etc. and last there come leaks in LabVIEW itself. This last category is very seldom but it has happened to me. However before going to scream about LabVIEW having a memory leak you really, really should make sure you have very intensivly researched all the other possibilities. The chance that you run into a memory leak in LabVIEW, while not impossible, is so small compared to the other ways of causing either a memory hog or running into a leak in an external component to LabVIEW, that in 99.9% of the cases where someone screams about a LabVIEW memory leak, he is simply wrong.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How can I address a memory leak problem with Firefox?

    I have happily used Firefox for the past 7 years, and have rarely had difficulties. However, I am having some trouble now; Firefox (running 3.6.6) seems to have a memory leak on my machine. It's slower than what was discussed in other forum posts, but it still scales up slowly to multiple hundred MBs of Memory with very little CPU usage.
    I have tried disabling add-ons and extensions, but this does not stop the problem. I have cleared my cache and other stored data, but that also does not help. Has anyone experienced a similar problem that might be able to help?
    == This happened ==
    Every time Firefox opened
    == within last two weeks

    Hi reble0708,
    I have Java console disabled on my Firefox browser.Everything is working fine for me. There maybe other problem on your browser which is making PDF document faded and blurry. Can you post the link where you found the problem viewing the PDF document?
    Btw, you can go to ftp://ftp.mozilla.org/pub/firefox/releases/ and select the previous version of Firefox from the given options. There's no need to uninstall Firefox before you downgrade to the previous version of it.But before new installation, backup your Firefox profile folder.
    edit: replaced random unofficial download site link.

  • How to solve UIDatePicker memory leak problem in iOS 5.1?

    Hi,
    I am developing an application in Xcode 4.3.2. There is a page where I am using UIDatePicker to enter DOB (Date of birth). The functionality works fine but I am facing problem of memory leaks with UIDatePicker. I am followed many forums but all they say is, UIDatepicker is faulty component; it is the bug in ios 5.1. Is that correct? Should I not use this component in my application? Can anybody guide me what should I do?
    Regards
    Anil 

    It's up to date. Anything else?

  • How to determine memory leaks?

    I tried in XCODE, the RUN/ Start with Performance TOol / and tried out the various options. I was running my app and looking to see if it would report increasing memory use but it seemed to be looking at my total system (i was running under the simulator). In general what is the recommended procedure for determining memory leaks, which tool to use, and what tracing can i use?
    How does one look at the retain count of an object? are there system routines that have knonw leaks?

    You took the right path. Once instruments comes up select the Leaks tool. Turn off automatic leak detection. In your app, start off at some known state, do something, and come back to the known state and check for leaks. For instance start off in a view, do something that brings up another view then come back to the original view and check for leaks. Leaks will show you if you leaked. Since you took a very deterministic path then checked it should be straight forward to go to the code and find / fix the leaks. Leaks shows you where the code where the leak was generated.

Maybe you are looking for

  • I can't get rid of iTunes match

    Hi everyone, I have a rather strange problem with my iTunes match. After having it for about two years my subscription recently expired and I did not renew it. I don't know if I have to defend my decision, but basically what it boils down to is that

  • Back ground job for automatic MRP run

    Hi pp guru, my client want for a particularly  material no XXXXXX ,there should be automatic MRP rum daily at 8:00 pm. kindly suggest me how i will map  back ground job in sap.. regards Aqueel

  • Connect from Oracle to Intersystem cache DB

    Hi DBA's I need to connect my Oracle DB to a db server Cache Intersystem somebody can tell me how to create a DBlink beetween the two system? After the db link creation i receive this message: SQL> create database link dbl_cachedb connect to sysadmin

  • Set event 100183 & 10027 in Oracle 11g

    Hi     I have upgraded the Oracle 10.2.0.4.0 to Oracle 11.2.0.2.0 . while running the script provided by SAP vide note no. 1171650 (Automated Oracle DB Parameter Check) , following recommendation comes after running the scripts means change the event

  • How do I correctly import the new Train CD (SONY PROTECTED)?

    While I have imported numerous CD's - I am having issues importing the new TRAIN CD that is SONY issued. The songs/track names have to be manually typed in....