Memory leak in GUI ??

hey all...
i have developed my java app.
if i leave ir running overnight and come back to it, it size is around 100,000k !
if i minimise the main window for my app (into the taskbar) and then click the taskbar to send it back onto the screen, it returns to the normal 10,000k....
why is this..?
is their some sort of memory leak in my gui?
do i need to code in some sort of refresh() for the gui ?
ive gone through all my code and checked for other causes of a memory leak and im fairly sure its the gui..
thanks...

Thanks for a good addition. I started to take care on these things when I wanted to make my classes reusable by me and by other people - like creating a library. There are situations you can't be sure your observable object will get out of scope. And - sometimes maintaining code for removing a listener takes less effort then maintaining that observable object will be garbage collected! Sometimes an opposite however.
Denis Krukovsky
http://dotuseful.sourceforge.net/

Similar Messages

  • Memory-Leak in communication of Acrobat-Flash and JS

    Hi
    The situation is as follows:
    I have a Flash-SWF (in which I have programmed a GUI)
    I have a 3D-Annotation containing an annotation-script with some functions that can be called from the GUI.
    So far so good.
    The SWF is added as overlay to a 3D-Annotation. The SWF contains some AS3-Functions, among them an enterframe-event, that keeps repeating an external-interface call to a function in the 3D Annotation-script. It works so far.
    When I tested for performance however I noticed that there is a memory-leak under these conditions. I tested my setup, and noticed the memory-useage increase by about 1 MB every 3 seconds. To further test this I stripped about everything from both the swfs Actionscript  and the annotation-JavaScript. Still the memory-useage of process "acrobat.exe*32" gradually climbs by 7-10 MB per minute. The memory-useage of "A3DUtility.exe" remains constant. Deactivating the annotation will decrease the memory-useage by a certain amount (though not to the initial value upon opening the file and starting the annotation) , but upon re-activating it immediately jumps back to the value assumed last before deactivating it. From that last value the increase starts again as well. I could observe this behaviour both in Acrobat 9 Pro Extended, Acrobat X and ReaderX.
    It seems something is wrong with the ExternalInterface-Object.

    OK, I'll do that.
    By the way, imho it's not that minor. ~1mb in two seconds sums up to ~30mb/minute, i.e. 2gb/hour. So if you leave your PDF open for some 15 minutes that's 500mb ram down the drain. Considering the file started at merely 30mb that's quite massive.

  • Memory leak with callback function

    Hi,
    I am fairly new to LabWindows and the ninetv library, i have mostly been working with LabVIEW.
    I am trying to create a basic (no GUI) c++ client that sets up subscriptions to several network variables publishing DAQ data from a PXI.
    The data for each variable is sent in a cluster and contains various datatypes along with a large int16 2D array for the data acquired(average array size is 100k in total, and the average time between data sent is 10ms). I have on average 10 of these DAQ variables.
    I am passing the same callback function as an arguement to all of these subscriptions(CNVCreateSubcription).
    It reads all the correct data, but i have one problem which is that i am experiencing a memory leak in the callback function that i pass to the CNVCreateSubscription.
    I have reduced the code one by one line and found the function that actually causes the memory leak, which is a CNVGetStructFields(). At this point in the program the data has still not been passed to the clients variables.
    This is a simplified version of the callback function, where i just unpack the cluster and get the data (only showing from one field in the cluster in the example, also not showing the decleration).
    The function is passed into to the subscribe function, like so:
    static void CNVCALLBACK SubscriberCallback(void * handle, CNVData data, void * callbackData);
    CNVCreateSubscriber (url.c_str(), SubscriberCallback, NULL, 0, CNVWaitForever, 0 , &subscriber);
    static void CNVCALLBACK SubscriberCallback(void * handle, CNVData data, void * callbackData)
    int16_t daqValue[100000];
    long unsigned int nDims;
    long unsigned int daqDims[2];
    CNVData fields[1];
    CNVDataType type;
    unsigned short int numFields;
    CNVGetDataType(data, &type, &nDims);
    CNVGetNumberOfStructFields (data, &numFields);
    CNVGetStructFields (data, fields, numFields); // <-------HERE IS THE PROBLEM, i can comment out the code after this point and it still causes a memory leak.
    CNVGetDataType(fields[0], &type, &nDims);
    CNVGetArrayDataDimensions(fields[0], nDims, acqDims);
    CNVGetArrayDataValue(fields[0], type, daqValue, daqDims[0]*daqDims[1]);
    CNVDisposeData(data);
    At the average settings i use all my systems memory (4GB) within one hour. 
    My question is, have any else experienced this and what could the problem/solution to this be?
    Thanks.
    Solved!
    Go to Solution.

    Of course.....if it is something i hate more than mistakes, it is obvious mistakes.
    Thank you for pointing it out, now everything works

  • Memory Leak with the new PatchMix App Beta?

    E6300/ASUS P5B-D/2GB RAM/EMU 0404/Vista Ultimate 32bit
    The problem happens after I upgrade to the PatchMix driver set dated 9/11.
    The physical memory usage bumps from ~24M to 150M after running 24 hours, and I didnt load any FX.
    The commit size(real memory usage) is over 500M!
    This doesnt happen with the old beta driver.
    Anyone has the same problem?

    Emon wrote:
    jreid wrote:
    Dare I suggest the problem might be Vista?
    Yes? How exactly would Vista cause a memory leak within PatchMix DSP's GUI?
    Well, just a thought. The OS is ultimately responsible for all memory management, and also the low-level graphics functions that would be called by e.g. the GUI code. I just noticed that people on XP didn't seem to be having the same problems with this beta.

  • Memory leak when redirecting to a remote XFree86 server

    Hi,
    I'm running a Java application, which controlls our network equipment.
    The application is written by our development team. It installs a graphical
    user frontend in order to allow interoperation with the network administrators.
    The application is run using the following environments:
    * Windows NT 4.0
    * Sun Solaris 8, local Xsun X11 server
    * Sun Solaris 8, XFree86 X11 server located on a linux host
    * Sun Solaris 8, CygWin/XFree86 X11 server running on a Windows NT host
    It turns out, that the application runs fine, if the application and the GUI either
    run both on a Windows NT host or the Sun workstation. However, if the application
    is launched on a Sun workstation and the X display is redirected to any XFree86
    X11 server, each change of the GUI focus - either forced by a mouse-click, or
    an canvas being changed by the application itsself - consumes an amount of
    3 MB of memory and never releases this again.
    So I suppose any memory leak in the Swing/X11 interface ...
    I've already searched SunSolve and installed all patches addressing memory leaks
    in Solaris 8 and Xsun ...
    Also our development team already has profiled the application using tools
    like OptimizeIt without being able to locate any memory leak.
    Has anyboday seen this before? Is there any bugfix/workaround available?
    Thx in advance,
    Jens Hamisch

    We just noticed the same problem for our Swing Applet using JDK 1.4 on Solaris 8 displayed to any remote X server running on Windows 2000 or Linux. If we let the applet run long enough (the plot in the applet updated every second), we could easily use up 500-600 Mb. Again, on the local console on Solaris or Windows 2000 the memory was stable at around 70 Mb.

  • Memory leak when refreshing table models

    Hi,
    I have a memory leak in a GUI app, and i have traced the problem down to some JTables I have which display data from a database (I used Netbeans profiler to look at the number of objects created for different classes, and there are a large number of classes like com.mysql.jdbc.ResultSet, com.mysql.jdbc.Statement, com.mysql.jdbc.Field[] accumulating, aswell as lots of byte[] and char[] arrays). The allocation stack traces for these objects seem to point to my table models where I do a lot of database lookups to create the model.
    Every time I am refreshing the tables, the Heap Space increases by a few MegaBytes, and a load of objects get created and retained. After refreshing the tables a number of times, the heap eventually gets filled and I get OutOfMemory error.
    The problem is I don't understand how this is happening - when the tables are refreshed, the code I use is something like this:
    setModel(new MyTableModel());
    So theoretically each time I refresh, the old model should be garbage collected (because setting the new model means there are no references to the old model), but I get the feeling that all the models are accumulating in the heap and not being collected. I dont understand why this could be - I was wondering if anyone had any ideas? (PS My table models dont use any static fields)
    Cheers,
    james

    Hi JacobsB,
    The reason I'm setting new models (which I dont normally do) is that each time the table is refreshed, the number and type of columns may change. Since altering the column model is quite complicated (there is no convenient removeColumn() method of any of the standard model classes) and involves messing around with the column model, which ends up screwing up the whole model (e.g. column renderers, column count, column class etc.) I decided it was actually easier to just create a new model instead! Is there a way to alter the column structure another way?
    later,
    James

  • Listener memory leaks

    Just noticed these warnings in my Tomcat log files.
    Not sure if they are cause for concern or if they indicate some mis-configuration on my side. Maybe some from the Oracle APEX team can take a look at it. Thanks.
    01-Dec-2014 17:38:25.924 WARNING [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [apex] appears to have started a thread named [UCP-worker-thread-24] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
    sun.misc.Unsafe.park(Native Method)
    java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
    java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
    java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
    java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    java.lang.Thread.run(Thread.java:745)
    01-Dec-2014 17:38:25.928 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [apex] created a ThreadLocal with key of type [org.apache.xmlbeans.impl.store.CharUtil$1] (value [org.apache.xmlbeans.impl.store.CharUtil$1@7de8083f]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@4f4bdbe7]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    01-Dec-2014 17:38:25.928 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [apex] created a ThreadLocal with key of type [org.apache.xmlbeans.XmlBeans$1] (value [org.apache.xmlbeans.XmlBeans$1@11a5e205]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@3faf4a40]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    01-Dec-2014 17:38:25.929 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [apex] created a ThreadLocal with key of type [org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl$1] (value [org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl$1@23b147a]) and a value of type [java.util.ArrayList] (value [[java.lang.ref.SoftReference@133e6339]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    01-Dec-2014 17:38:25.929 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [apex] created a ThreadLocal with key of type [org.apache.xmlbeans.impl.store.Locale$1] (value [org.apache.xmlbeans.impl.store.Locale$1@2db50e91]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@680dac2d]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

    There was another time that I dabbled in this idea.
    But it always comes back to objects cleaning up
    after themselves. Now if its not your code and you
    cant ensure good behavior, then perhaps there is
    cause. But I'd keep an assert and report the issue
    if I saw it trigger.What would fire the assert? The Listener will never be garbage collected while it is listening to something. I assume that you are talking about when the listener is a Swing Object like a JFrame. I don't really like to use gui components as listeners.
    If you have to write a clean up method, it kind of defeats the value of having automatic garbage collection to a degree. I like to be able to let my Objects just fall out of scope or just become unreachable when they are no longer needed without having to actively manage their deallocation.

  • TestStand 3.1 Report Memory Leak

    Hi everyone,
    I been looking at the memory usage of my TestStand code lately.  I noticed I have a memory leak with On The Fly Reporting using XML report file.  I'm currenlty using labview 7.1.1 and TestStand 3.1f for development.   I came about this program from seeing test station go to a snails crawl.  The program starts out around 100MB and will keep growing using up all the systems memory, the largest I seen was 500MB.   What is happening is the testers like to keep the on the fly report screen up during the test  and not view the execusion window.  At the end of each run the program will grow 10MB to 30MB.    I know the problem can be solved by turning off on the fly reporting, but I would like to try find a programing option first.
    I have looked at the other forum entries about:
    Turning off database collection
    Editing  model options : ModelOptions.DiscardUnusedResults = True and Parameters.ModelOptions.NumTestSockets = 1
    Adjusted the array size of the report to 300
    None of the options seem to have worked for me, most the post say move to teststand 3.1 cause it an 3.0 issue.
    I was wondering if there are any other options to try  in teststand, or any way to turn off/close IE to release memory between tests.
    I'm currently running the code on Windows XP SP2 
    IE6/IE7 depending on the test station
    P4 or Centrino  with 512MB to 1GB of ram
    The GUI window is a modifed  example of the basic VI EXE that calls teststand
    The code is installed using labview and Teststand  deployment builders, so the test machine are using runtime labview 7.1.1  and runtime TestStand 3.1
    Thanks to any one who can offer alittle extra help on the topic

    Actually the reports are XML not HTML.
    There are alot of pass steps, usualy after a couple of failed steps, the sequence will terminate.
    The memory leak seem to exaggerated, since the technicians like to view the Reports Tab instead of Execution Tab when running program.  If the operator keeps the view on the execution tab during the program, the report screen is not being updated, so less memory is taken up.  Since the techs like to keep the report screen up during the entire test, the xml file constantly being update and  the program increases +50MB after the first run.   So turning off Reports on the fly, they can not view the report during the test and the memory usuage stays low.
    I do not see a leak at all if I do not click on the reports tab,  and the leak seems to only happen with XML files, TXT and HTML reports do not cause a memory leak, even when viewed on the fly for the entire test.   I wanted to keep XML-expandable cause it easier to see what sequences failed then scanning through the entire report.
    I'm using Test UUT call up the test.    The executable terminated if you press the exit button on the executable.  After test is finished, the standard Pass/Fail comes up then the standard  enter UUT serial number comes up.
    I'm including the reports option INI  I use .
    Thanks for you help in this matter, sorry being little late with replying. 
    Attachments:
    report.ini ‏4 KB

  • How to track Memory Leaks in 3.6.8?

    I've been noticing for several updates now that I seem to be getting major memory leaks. Firefox starts off around 1-200,000 K memory usage in task manager, but within a few hours it will be past 800,000 K. Now, the things I've seen so far talk about disabling plugins and all to find the problem, but this doesn't happen immediately, so disabling things one by one isn't very feasible. How can i track the memory leak to a specific plugin, or else make it leak much, much faster so I can do the one by one thing?
    == This happened ==
    Every time Firefox opened
    == A few updates ago

    Well, It just has taken a turn for the worse... In the attached screenshot you can see firefox took 1.123.112kb out of my memory at which point the GUI became unresponsive. This has actually happened before, but not as soon...
    I had 18 tabs open (but at the moment I have all of them opened again after a restart of firefox and it takes 143.988 kb at this very moment, which still is a lot actually). My computer has 4gb RAM-memory of which 46% is in use at the moment according to windows task manager.
    It would be great if the whole tabstructure and maybe the garbage collector for the TraceMonkey javascript engine was reviewed... This might point out where the memory leaks are located.

  • Memory leak checking doesn't work: SEGV problem while debugging with dbx

    I am debugging a program which has memory leaks.
    When I do the following:
    dbx <program>
    (dbx) run <input parameters>
    everything runs fine, but as I didn't use RTC leaks checking, this is of no use. Therefore I do the following:
    dbx <program>
    (dbx) check -memuse
    memuse checking - ON
    (dbx) check -leaks -frames 8
    leaks checking - ON
    (dbx) run <input parameters>
    which gives the following result:
    Running: <program> <input parameters>
    (process id 17075)
    Reading rtcapihook.so
    Reading rtcaudit.so
    Reading libmapmalloc.so.1
    Reading rtcboot.so
    Reading librtc.so
    RTC: Enabling Error Checking...
    t@1 (l@1) signal SEGV (no mapping at the fault address) in __rtc_memcpy at 0xffffffff7312ed90
    0xffffffff7312ed90: __rtc_memcpy+0x0014: st %o4, [%o0 + %o3]
    dbx: Stopped within call to '__rtc_suppress_always'. Starting new command interpreter
    (dbx) where -l
    current thread: t@1
    [1] libaio.so.1:_init(0xfffffffe52000058, 0x0, 0xffdfffff, 0xfffffffe52000030, 0x400000, 0x80000), at 0xfffffffe55907a90
    [2] ld.so.1[L]:setup(0xffffffff7ffff250, 0x0, 0xffffffff7f72c2b0, 0x10000, 0x0, 0x0), at 0xffffffff7f610ba4
    [3] ld.so.1[L]:_setup(0xffffffff7fffffab, 0x1f, 0xffffffff7ffff640, 0xffffffff7fffffbe, 0xffffffff7ffff628, 0xffffffff7f72dde8), at 0xffffffff7f61f24c
    [4] ld.so.1[L]:_rt_boot(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xffffffff7f6052d4
    I think this means that there is a problem within my 'RTC' libraries.
    When I run the "version" command within my dbx session, I get following results:
    (dbx) version
    Machine hardware: sun4u
    OS version: 5.9
    Processor type: sparc
    Hardware: SUNW,Sun-Fire-480R
    The following components are installed on your system:
    Sun Studio 9
    Sun Studio 9 C Compiler
    Sun Studio 9 C++ Compiler
    Sun Studio 9 Tools.h++ 7.1
    Sun Studio 9 C++ Standard 64-bit Class Library
    Sun Studio 9 Garbage Collector
    Sun Studio 9 Fortran 95
    Sun Studio 9 Debugging Tools (including dbx)
    Sun Studio 9 Debugger GUI
    Sun Studio 9 Performance Tools (including collect, ...)
    Sun Studio 9 X-Designer
    Sun Studio 9 VIM editor
    Sun Studio 9 XEmacs editor
    Sun Studio 9 Native Connector Tool
    Sun Studio 9 LockLint
    Sun Studio 9 Building Software (including dmake)
    Sun Studio 9 Documentation Set
    version of "/opt/SUNWspro/bin/../prod/bin/../../bin/cc": Sun C 5.6 2004/07/15
    version of "/opt/SUNWspro/bin/../prod/bin/../../bin/CC": Sun C++ 5.6 2004/07/15
    version of "/opt/SUNWspro/bin/../prod/bin/../../bin/f90": Sun Fortran 95 8.0 2004/07/15
    version of "/opt/SUNWspro/bin/../prod/bin/../../bin/dbx": Sun Dbx Debugger 7.3 2004/07/15
    version of "/opt/SUNWspro/bin/../prod/bin/../../bin/analyzer": Sun Performance Analyzer 7.3 2004/07/15
    version of "/opt/SUNWspro/bin/../prod/bin/../../bin/dmake": Sun Distributed Make 7.5 2004/07/15
    Can anybody help me out?
    Which additional information do I need to provide in order to solve this issue?
    Message was edited by: B.V. (the "where -l" command has been added
    B.V.

    Hello Maxim,
    As you said, it was worth to try, but unfortunately, it was not a very good investment :-(
    The patch 117564-06 has been installed, and I have retried the same procedure, but the same problem occurs.
    As you have mentioned in a previous reply, I have flagged the "rtc_error_stack" before launching the "where" command.
    The result is the following:
    Running: <program> <input parameters>
    (process id 21873)
    Reading rtcapihook.so
    Reading rtcaudit.so
    Reading libmapmalloc.so.1
    Reading rtcboot.so
    Reading librtc.so
    RTC: Enabling Error Checking...
    t@1 (l@1) signal SEGV (no mapping at the fault address) in __rtc_memcpy at 0xffffffff7312f068
    0xffffffff7312f068: __rtc_memcpy+0x0014: st %o4, [%o0 + %o3]
    dbx: Stopped within call to '__rtc_suppress_always'. Starting new command interpreter
    (dbx) dbxenv rtc_error_stack on
    (dbx) where -l
    current thread: t@1
    =>[1] librtc.so[0xffffffff7de01778]:__rtc_memcpy(0xfffffffe5013fff0, 0xfffffffe50220040, 0x8, 0x
    10, 0x803, 0x64a3c338), at 0xffffffff7312f068
    [2] librtc.so[0xffffffff7de01778]:change_masks_work(0xfffffffeff90e878, 0xfffffffeff90e878, 0x
    803, 0x2, 0x0, 0xffffffff73243608), at 0xffffffff7312e618
    ---------- called from debugger ----------
    [3] libmd5.so.1:_init(0xfffffffe50b00228, 0x0, 0xffdfffff, 0xfffffffe50b00208, 0x400000, 0x800
    00), at 0xfffffffe531016e0
    [4] ld.so.1[L]:setup(0xffffffff7ffff260, 0x0, 0xffffffff7f72c2b0, 0x10000, 0x0, 0x0), at 0xfff
    fffff7f610ba4
    [5] ld.so.1[L]:_setup(0xffffffff7fffffa6, 0x1f, 0xffffffff7ffff650, 0xffffffff7fffffb9, 0xffff
    ffff7ffff638, 0xffffffff7f72dde8), at 0xffffffff7f61f24c
    [6] ld.so.1[L]:_rt_boot(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xffffffff7f6052d4
    (dbx)
    Any ideas?
    Thanks
    Dominique

  • How to configure JProfiler6 to monitor tomcat6.0 for memory leak

    Hello,
    Can anyone help. I am tring to work out the memory leak of my Web Application running on the local server. I have been told that jprofiler is a good tool for monitoring memory. I have dowloaded jprofiler6, but I dont know how to config the setting.
    what i have done is:
    1.from the Quickstart window->An application server, locally or remotely
    2.follow the wizard step by step
    1)choose application server Apache Tomcat 6.x
    2)application is located "on this computer"
    3) Chose JVM vendor
    4) wait for a connection from the JProfiler GUI
    5) Locate the start script :C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.20\bin\startup.bat
    6) port:8849
    7)finished
    After i done these, a error message came out said:
    "Could not connect ot 127.0.0.1:8849.Please make sure that the remote address is correct, the remote program is started properly and the netword route allows socket connections."

    Hi,
    The recommended solution is to download Oracle JRockit Mission Control (available here: http://www.oracle.com/technology/software/products/jrockit/index.html) and install on your server. The installers include Oracle JRockit JVM as well as Mission Control, and are free of license checks.
    If that solution for some reason is unfeasible you can download legacy development license files from here (http://download2.bea.com/pub/license/All%20Products/BEA_WebLogic.zip).
    The license you are looking for is named “LIC-WLRT20.txt”. Rename it to license.bea, and follow the instructions at http://edocs.bea.com/jrockit/geninfo/diagnos/conf_run.html#wp1077371

  • 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.

  • Memory leak in JSpinner implementation (maybe others?)

    Hi,
    I am developing an application using Java and Swing, and have run into some problems with memory leaks. After examining the source code and making an example program (provided below), I can only come to the conclusion that there is a bug in the implementation of JSpinner in Sun Java 1.6.0_03.
    If one uses a custom model with the JSpinner, it attaches itself as a listener to the model. However, it never removes the listening connection, even if the model is changed. This causes the JSpinner to be kept in memory as long as the model exists, even if all other references to the component have been removed.
    An example program is available at http://eddie.dy.fi/~sampo/ModelTest.java . It is a simple swing program that has the JSpinner and two buttons, the first of which writes to stdout the listeners of the original model and the second changes the spinner model to a newly-created model. A sample output is below:
    Running on 1.6.0_03 from Sun Microsystems Inc.
    Listeners before connecting to JSpinner:
      Model value is 0, 0 listeners connected:
    Listeners after connecting to JSpinner:
      Model value is 0, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971ad
    Listeners now:
      Model value is 8, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971ad
    Changing spinner model.
    Listeners now:
      Model value is 8, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971adThis shows that even though the model of the JSpinner has been changed, it still listens to the original model. I haven't looked at other components whether they retain connections to the old models as well.
    In my case, I have an adaptor-model which provides a SpinnerModel interface to the actual data. The adaptor is implemented so that it listens to the underlying model only when it itself is being listened to. If the JComponents using the model were to remove the listening connections, it, too, would be automatically garbage-collected. However, since JSpinner does not remove the connections, the adaptor also continues to listen to the underlying model, and neither can be garbage-collected.
    All in all, the listener-connections seem to be a very easy place to make memory leaks in Java and especially in Swing. However, as I see it, it would be a simple matter to make everything work automatically with one simple rule: Listen to the models only when necessary.
    If a component is hidden (or alternatively has no contact to a parent JFrame or equivalent), it does not need to listen to the model and should remove the connections. When the component is again set visible (or connected to a frame) it can re-add the connections and re-read the current model values just as it does when initializing the component. Similarly, any adaptor-models should listen to the underlying model only when it itself is being listened to.
    If the components were implemented in this way, one could simply remove a component from the frame and throw it away, and automatically any listener-connections will be removed and it can be garbage-collected. Similarly any adaptor-models are collected when they are no longer in use.
    Changing the API implementation in this way would not require any changes to applications, as the only thing that changes are the listener-connections. Currently used separate connection-removing methods should still work, though they would be unnecessary any more. The API would look exactly the same from the view of an application programmer, only that she would not need to care about remnant listening connections. (As far as I can tell, the current API specification would allow the API to be implemented as described above, but it should of course require it to be implemented in such a way.)
    Am I missing something, or is there some valid reason why the API is not implemented like this?
    PS. I'm new to these forums, so if there is a better place to post these reports, please tell me. Thanks.

    Another cognition: It's the following code, that causes the memory to be accumulated:
    obj = m_orb.resolve_initial_references("NameService");
    ctx = NamingContextExtHelper.narrow(obj);For the first 4 calls to this code the memory usage of the nameservice is unchanged. From the 5th to the 8th call, it's increased by approx. 10KB per call. And thenceforward (beginning with the 9th call) it's increasing by approx. 10MB.
    What's going wrong here?

  • Memory Leaks   Unresponsive Mouse

    2009 8 core Mac Pro w/ 24 GB of RAM, ATI Radeon 4870, and a SeriTek PCIe eSATA card (card only has drives connected when running a manual drive clone).  When running Toast 10 or Parallels 9, my RAM will fill up (I use a program called Menu Meters to monitor stuff).  This machine worked just fine under OS 10.9 and earlier - no issues like this at all.  ClamXAV will also completely fill the RAM up (the meter will be full green, instead of part green, then mostly grey when Toast or Parallels fills it up).  I have to use Terminal to purge it so that the machine is usable.
    The other thing that happens is that sometimes when the computer wakes up or I am in the middle of doing something, the mouse will still move, but the dock will not pop open and the left button the mouse doesn't respond.  The right button will open the right click menu, but will not respond normally at all.  I have tried a different Magic Mouse, but the problem is the same.
    I thought that it may be a problem with the factory RAM and the Kingston RAM not playing nicely together.  So I ran it with just the factory 8 GB and then ran it with the Kingston 16 GB - the problem persists no matter which RAM is installed.  All of the RAM also passes the memory tests in Rember and TechTool.
    So, I need to find out if someone thinks that maybe the bluetooth module may be going bad causing the mouse issues.  I also need to find out what is causing the memory leaks.  I followed the steps that someone gave on this site to boot into safe mode, repair permissions, reset PRAM, then reset SMC (or the other way around - I did it like they said to).  It did nothing to fix the problem.
    I need some guidance here.  As I stated early on, the machine worked perfectly with OS 10.9.  I have WAY too much software that I use, so doing a completely fresh install is out of the question - I don't have time to reload everything.  This problem is annoying and I know that I am not the only one having these issues.  Any input will be greatly appreciated.  Thanks in advance.

    Here is the EtreCheck report:
    Problem description:
    Memory leaks when using Toast 10 or Parallels 9.  Mouse also become unresponsive (it will move, but left button does not work and dock will not pop open - mouse problem happens independent of the RAM being filled up - different mouse was tried with same result).
    EtreCheck version: 2.1.5 (108)
    Report generated January 9, 2015 at 9:20:59 PM MST
    Click the [Support] links for help with non-Apple products.
    Click the [Details] links for more information about that line.
    Click the [Adware] links for help removing adware.
    Hardware Information: ℹ️
        Mac Pro (Early 2009) (Verified)
        Mac Pro - model: MacPro4,1
        2 2.26 GHz Quad-Core Intel Xeon CPU: 8-core
        24 GB RAM Upgradeable
            DIMM 1
                4 GB DDR3 ECC 1066 MHz ok
            DIMM 2
                4 GB DDR3 ECC 1066 MHz ok
            DIMM 3
                2 GB DDR3 ECC 1066 MHz ok
            DIMM 4
                2 GB DDR3 ECC 1066 MHz ok
            DIMM 5
                4 GB DDR3 ECC 1066 MHz ok
            DIMM 6
                4 GB DDR3 ECC 1066 MHz ok
            DIMM 7
                2 GB DDR3 ECC 1066 MHz ok
            DIMM 8
                2 GB DDR3 ECC 1066 MHz ok
        Bluetooth: Old - Handoff/Airdrop2 not supported
        Wireless:  en2: 802.11 a/b/g/n
    Video Information: ℹ️
        ATI Radeon HD 4870 - VRAM: 512 MB
            AL2216W 1680 x 1050 @ 60 Hz
    System Software: ℹ️
        OS X 10.10.1 (14B25) - Uptime: 2:4:35
    Disk Information: ℹ️
        HL-DT-ST BD-RE  WH12LS39 
        HL-DT-ST DVDRAM GH24NS90 
        SAMSUNG HD103SJ disk1 : (1 TB)
            EFI (disk1s1) <not mounted> : 210 MB
            OS 10.10.1 (disk1s2) / : 999.35 GB (410.30 GB free)
            Recovery HD (disk1s3) <not mounted>  [Recovery]: 650 MB
        SAMSUNG HD103SJ disk2 : (1 TB)
            EFI (disk2s1) <not mounted> : 210 MB
            Extra Storage (disk2s2) /Volumes/Extra Storage : 999.86 GB (554.20 GB free)
        SAMSUNG HD103SJ disk3 : (1 TB)
            EFI (disk3s1) <not mounted> : 210 MB
            Extra Storage 2 - Scratch (disk3s2) /Volumes/Extra Storage 2 - Scratch : 999.86 GB (39.54 GB free)
        WDC WD5001AALS-00LWTA0 disk0 : (500.11 GB)
            EFI (disk0s1) <not mounted> : 210 MB
            BOOTCAMP (disk0s2) /Volumes/BOOTCAMP : 499.90 GB (275.71 GB free)
    USB Information: ℹ️
        Shuttle Technology Inc. E-USB Bridge
        Sony C6606
        Apple, Inc. Keyboard Hub
            Apple Inc. Apple Keyboard
        Apple Inc. BRCM2046 Hub
            Apple Inc. Bluetooth USB Host Controller
    Firewire Information: ℹ️
        Apple Computer, Inc. iSight 200mbit - 400mbit max
    Gatekeeper: ℹ️
        Anywhere
    Kernel Extensions: ℹ️
            /Applications/Hotspot Shield.app
        [not loaded]    com.anchorfree.tun (1.0) [Support]
            /Applications/Parallels Desktop.app
        [not loaded]    com.parallels.kext.hidhook (9.0 24251.1052177) [Support]
        [not loaded]    com.parallels.kext.hypervisor (9.0 24251.1052177) [Support]
        [not loaded]    com.parallels.kext.netbridge (9.0 24251.1052177) [Support]
        [not loaded]    com.parallels.kext.usbconnect (9.0 24251.1052177) [Support]
        [not loaded]    com.parallels.kext.vnic (9.0 24251.1052177) [Support]
            /Applications/TechTool Deluxe.app
        [not loaded]    com.micromat.iokit.ttpatadriver (5.0.0) [Support]
        [not loaded]    com.micromat.iokit.ttpfwdriver (5.0.0) [Support]
            /Applications/TechTool Protogo/Protogo Applications/TechTool Pro 7.app
        [not loaded]    com.micromat.driver.spdKernel (1 - SDK 10.8) [Support]
        [not loaded]    com.micromat.driver.spdKernel-10-8 (1 - SDK 10.8) [Support]
            /Applications/Temperature Monitor 4.94/Temperature Monitor 4.94.app
        [not loaded]    com.bresink.driver.BRESINKx86Monitoring (8.0) [Support]
            /Applications/Toast 11 Titanium/Spin Doctor.app
        [not loaded]    com.hzsystems.terminus.driver (4) [Support]
            /Applications/Toast 7 Titanium/Toast Titanium.app
        [not loaded]    com.roxio.TDIXController (1.6) [Support]
            /Library/Extensions
        [loaded]    at.obdev.nke.LittleSnitch (4216 - SDK 10.8) [Support]
            /System/Library/Extensions
        [loaded]    com.SiliconImage.driver.Si3132 (1.2.5) [Support]
        [not loaded]    com.devguru.driver.SamsungComposite (1.2.63 - SDK 10.6) [Support]
        [not loaded]    com.microsoft.driver.MicrosoftMouse (8.2) [Support]
        [not loaded]    com.roxio.BluRaySupport (1.1.6) [Support]
            /System/Library/Extensions/MicrosoftMouse.kext/Contents/PlugIns
        [not loaded]    com.microsoft.driver.MicrosoftMouseBluetooth (8.2) [Support]
        [not loaded]    com.microsoft.driver.MicrosoftMouseUSB (8.2) [Support]
            /System/Library/Extensions/ssuddrv.kext/Contents/PlugIns
        [not loaded]    com.devguru.driver.SamsungACMControl (1.2.63 - SDK 10.6) [Support]
        [not loaded]    com.devguru.driver.SamsungACMData (1.2.63 - SDK 10.6) [Support]
        [not loaded]    com.devguru.driver.SamsungMTP (1.2.63 - SDK 10.5) [Support]
        [not loaded]    com.devguru.driver.SamsungSerial (1.2.63 - SDK 10.6) [Support]
    Startup Items: ℹ️
        HP IO: Path: /Library/StartupItems/HP IO
        SiCoreService: Path: /Library/StartupItems/SiCoreService
        Startup items are obsolete in OS X Yosemite
    Launch Agents: ℹ️
        [running]    at.obdev.LittleSnitchUIAgent.plist [Support]
        [loaded]    com.coupons.coupond.plist [Support]
        [running]    com.micromat.TechToolProAgent.plist [Support]
        [loaded]    com.oracle.java.Java-Updater.plist [Support]
        [invalid?]    com.parallels.mobile.prl_deskctl_agent.launchagent.plist [Support]
        [invalid?]    com.parallels.mobile.startgui.launchagent.plist [Support]
        [not loaded]    com.teamviewer.teamviewer.plist [Support]
        [not loaded]    com.teamviewer.teamviewer_desktop.plist [Support]
    Launch Daemons: ℹ️
        [running]    at.obdev.littlesnitchd.plist [Support]
        [loaded]    com.adobe.fpsaud.plist [Support]
        [loaded]    com.bombich.ccc.plist [Support]
        [loaded]    com.hp.lightscribe.plist [Support]
        [running]    com.micromat.TechToolProDaemon.plist [Support]
        [loaded]    com.microsoft.office.licensing.helper.plist [Support]
        [loaded]    com.oracle.java.Helper-Tool.plist [Support]
        [invalid?]    com.parallels.mobile.dispatcher.launchdaemon.plist [Support]
        [failed]    com.parallels.mobile.kextloader.launchdaemon.plist [Support] [Details]
        [not loaded]    com.teamviewer.teamviewer_service.plist [Support]
    User Launch Agents: ℹ️
        [loaded]    com.facebook.videochat.[redacted].plist [Support]
        [loaded]    com.google.keystone.agent.plist [Support]
        [running]    com.nchsoftware.expressinvoice.agent.plist [Support]
        [loaded]    uk.co.markallan.clamxav.clamscan.plist [Support]
        [loaded]    uk.co.markallan.clamxav.freshclam.plist [Support]
    User Login Items: ℹ️
        iTunesHelper    Application (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
        SMARTReporter    Application (/Applications/SMARTReporter/SMARTReporter.app)
        BetterSnapTool    Application (/Applications/BetterSnapTool.app)
        smcFanControl    Application (/Applications/smcfancontrol_2_2_2/smcFanControl.app)
        Android File Transfer Agent    Application (/Users/[redacted]/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent.app)
    Internet Plug-ins: ℹ️
        JavaAppletPlugin: Version: Java 8 Update 25 Check version
        FlashPlayer-10.6: Version: 16.0.0.235 - SDK 10.6 [Support]
        Default Browser: Version: 600 - SDK 10.10
        AdobePDFViewerNPAPI: Version: 11.0.06 - SDK 10.6 [Support]
        CouponPrinter-FireFox_v2: Version: 5.0.3 - SDK 10.6 [Support]
        AdobePDFViewer: Version: 11.0.06 - SDK 10.6 [Support]
        Flash Player: Version: 16.0.0.235 - SDK 10.6 [Support]
        QuickTime Plugin: Version: 7.7.3
        SharePointBrowserPlugin: Version: 14.4.6 - SDK 10.6 [Support]
        iPhotoPhotocast: Version: 7.0 - SDK 10.8
    Safari Extensions: ℹ️
        AdBlock [Installed]
        F.B. Purity - Cleans Up Facebook [Installed]
        OpenIE [Installed]
    3rd Party Preference Panes: ℹ️
        Déjà Vu  [Support]
        Flash Player  [Support]
        FUSE for OS X (OSXFUSE)  [Support]
        Java  [Support]
        MacFUSE  [Support]
        MenuMeters  [Support]
        Microsoft Mouse  [Support]
        MouseLocator  [Support]
        NTFS-3G  [Support]
        TechTool Protection  [Support]
    Time Machine: ℹ️
        Time Machine not configured!
    Top Processes by CPU: ℹ️
            48%    plugin-container
            39%    fontd
             6%    firefox
             5%    WindowServer
             4%    bluetoothaudiod
    Top Processes by Memory: ℹ️
        928 MB    firefox
        412 MB    plugin-container
        258 MB    mds_stores
        180 MB    iTunes
        129 MB    Finder
    Virtual Memory Information: ℹ️
        19.38 GB    Free RAM
        3.11 GB    Active RAM
        1.88 GB    Inactive RAM
        1.38 GB    Wired RAM
        2.40 GB    Page-ins
        0 B    Page-outs
    Diagnostics Information: ℹ️
        Jan 9, 2015, 07:16:57 PM    Self test - passed
        Jan 8, 2015, 11:37:48 AM    /Library/Logs/DiagnosticReports/ClamXav_2015-01-08-113748_[redacted].cpu_resour ce.diag [Details]
        Jan 8, 2015, 11:21:46 AM    /Users/[redacted]/Library/Logs/DiagnosticReports/Preview_2015-01-08-112146_[red acted].crash

  • T61 with memory leak on XP for driver battc.sys

    Hi
    I have an issue with XP where the battc.sys module that is part of Windows XP and responsible for the kernel side of monitoring the battery status. This module continually leaks memory until I have no more kernel paged resources left and programs start to fail on my laptop.
    I raised a support case for this with Microsoft and after some investigation and upgrading to the latest T61 power drivers that were released a few days ago on the Lenovo site, MS support told me it is a fault of the T61 and that I would need to disable Microsoft APCI support to stop this memory leak from occuring and to take the issue up with Lenovo.
    I have used the verifier tool to confirm that it is the Windows XP SP3 battc.sys memory module leaking.
    I am running the latest T61 drivers and fully patch with MS drivers on SP3.
    As MS have told me it is the fault of the T61 I am posting this issue here.
    Thanks
    Stephen

    It is memory available to the kernelwhich itself does not show under a process in task manager as far as I am aware (unles it is taken account as part of the system process).
    The best way to measure the available kernel memory space available is by using sysinternals procexp.
    You need to download procexp and also install the windows debugging tools from Microsoft. Then in procexp set the "Options > Configure Symbols : Debughlp.dll path" to the new debughlp.dll installed with your debu tools and set the symbols path to srv*c:\Symbols*http://msdl.microsoft.com/download/symbols
    Then you can choose in procexp "View > System Information" and see the used and total paged and non-paged kernel memory space.
    poolmon helps monitor all the symbols that are taking up this memory and verifier lets you drill down to the exact module and the changes in memory for a module that is occuring.
    Here are two really good links on it
    http://blogs.msdn.com/ntdebugging/archive/2006/12/18/Understanding-Pool-Consumption-and-Event-ID_3A0...
    http://blogs.msdn.com/ntdebugging/archive/2008/05/08/tracking-down-mmst-paged-pool-usage.aspx
    In my poolmon i notice that Mmst and battc are taking alot of memory after my computer has been running for some time. Mmst being high is normal but battc should not continually be growing as it is which is why I raised the case to MS but they want verification it is not a Lenovo issue.

Maybe you are looking for

  • Auto Populate one Field Based on Another Field

    I am trying to populate the description field after the user has entered a value in the item number field and then tabs or otherwise exits the item number field. I'm sure this is in the documentation somewhere, but I'm in a big hurry. By the way, thi

  • I'm unable to use the domain with a .uk domain suffix with 2012 essentials

    I'm trying to link a domain I wish to use in office 365 to the essentials server but I receive "The domain name is not valid"when going through the "link domain to Office365" wizard, I also receive the same error when running through the anywhere acc

  • Will Apple replace my apple tv cable for free?

    My apple tv cable is broken ( power cable not hdmi ) and i was wondering if i called apple, would they replace it for free? or would i have to pay for it? If yes, how much in CAD

  • Make payment before issue sales order

    Dear all, Here is my problem. After customer agreed on the sales quotation, I had to collect payment from customer before issuing a sales order. How can it be done in SBO? i tried AR reserved invoice but sales order had closed after adding AR reserve

  • Problem Upgrading Udev: /lib/udev/root-link.sh: exists in filesystem

    Targets: amarok-base-1.4.5-2 amarok-engine-xine-1.4.5-2 aquamarine-svn-3810-1 beryl-core-svn-3871-1 beryl-manager-svn-3810-1 beryl-plugins-svn-3883-1 beryl-settings-bindings-svn-3550-2 beryl-settings-svn-3885-1 bison-2.3-2 dbus-1.0.2-4 dbus-glib-0.73