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.

Similar Messages

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

  • How to determine memory usage?

    Is there something built into OSX that permits me to monitor and/or log memory usage?
    I use Logic Pro and FCP and would like to know if I reaching the limits of my memory (4GB) with the type of work I do.
    Thanks, Rob.

    How To Determine Your Memory Needs >>
    -Bmer
    Mac Owners Support Group
    Join Us @ MacOSG.com
    ITMS: MacOSG Podcast
     An Apple User Group 
    Disclaimer required by Apple Discussions Terms of Use: MacOSG - a non-profit Apple User Group - may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • 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 :)

  • How to determine memory board type and speed

    Hello.
    How can I determine the type of board and connector (e.g., SIMM, SODIMM, etc.) my Thinkpad W700 uses? How can I determine what the bus speed is, and then what speed memory I need?
    Thanks.

    GMAC-R60 wrote:
    go here enter your model & type number http://www-307.ibm.com/pc/support/site.wss/product.do?template=%2Fproductselection%2Flandingpages%2F... then click on product information
    Thanks. It took a bit of clicking around, but apparently my laptop's memory is on two SO-DIMM, DDR3, 1067 MHz slots.
    Memory
    PC3-8500 Non-Parity (NP) Double Data Rate Three (DDR3) Technology
    Two SO-DIMM SlotsThe use of 1067 MHz SO DIMM memory is recommended for this system.
    512 MB, 1 GB, 2GB, or 4GB memory
    Supports up to 8GB maximum memory
    2GB Intel Turbo Memory (selected models)
    Note: Only 64-bit operating systems support more than 3GB of system memory (RAM).

  • 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 to minimize memory leaks when auto-refreshing datasets

    I have a page with two Spry datasets, each of which has a
    loadInterval of 30 seconds to 1 minute. Looking at the Windows Task
    Manager, I see that Firefox 3 consumes 500,000kb of Working Set
    memory after about 2.5 hours of no activity (other than leaving the
    page open). When first loaded, Firefox was using 130,000kb, so
    that's an increase of 370,000kb. Similarly, IE 7 increases from
    73,000 to 130,000 in the same time period.
    Is there anything that I can do programmatically to minimize
    or eliminate this problem?

    Thanks for the response. I need to refresh frequently because
    the application is a kind of "dashboard" to show the status of
    certain activities; when one of the activities occurs, the mySQL
    database reflects the change, and I want the Spry dataset to show
    the change to the user in more or less "real time."
    I am a little unclear about your last two suggestions. When
    you say, "you should generate XML files first then use it as
    dataset instead directly your server side as xml on dataset url" do
    you mean that I should NOT create the xml for the dataset
    dynamically using a php script? (I am creating it dynamically
    because that's the only way I know to get "fresh" up-to-the-moment
    data. Am I missing something? And why does it matter HOW the xml is
    created?
    Also, can you explain how you're suggesting that I use the
    javascript timeout with Spry SetURL(). I like the idea of trying to
    empty the dataset, but don't understand how to implement it
    (concenptually).
    Thanks!

  • How to track memory leak

    using an n85, i consistantly have problems when i'm in my call log.  i get "log:memory full. close some applications and try again." even though i rebooted and when i check under open apps (by holding down app key), no program is open. i also have 69 megs free in phone memory (per file manager). is there a program that lists what processes are taking up memory (kinda of like MS's windows task manager or linux's TOP command)?

    i did both hard resets-3key+ on button, and also 7380 method, which both work (it asks for country, time, etc), then when i restore, i get same problem. seeing how i can use other programs-web browser, gps programs, etc without any 'memory full' problem, i think it's a problem w/ the memory allocated just to the log program-and i'm running in that limit. also, i use my phone for voip calls, and the phone numbers are longer-in the 'sip:[email protected]' format, and i'm not sure if it has something to do with that. will see if the developer forum has additional info. thanks for your help!

  • Memory leak in JCO when calling an ABAP-function that returns larg tables

    Hello everybody,
    I think discovered a memory leak in JCO when the calling functionions that have exporting tables with large datasets. For example the ABAP-function RFC_READ_TABLE, which in this example I use to retrieve data from a table called "RSZELTTXT", which contains ~ 120000 datasets. RFC_READ_TABLE exports the data as table "DATA".
    Here a simple JUnit test:
    http://pastebin.ca/1420451
    When running it with Sun Java 1.6 with standard heap size of 64mb I get a heapsize OutOfMemory error:
    http://pastebin.ca/1420472
    Looking at the heap dump (which I unfortunately cannot post here, because of it' size), I can see that I've 65000 char[512] array objects in my heap, which don't get cleaned up. I think, each char[512] array stands for one dataset in the exporting table "DATA", since the table contains 120000 datasets, the heap is full after the first 65000 datasets are parsed. Apparently, JCO tries to read all datasets in memory instead of justing reading the dataset to which the pointer (JCoTable.setRow(i)) currently points to and releasing it from memory after the pointer moves forward ...
    Did anybody else experience this?
    Is SAP going to remove to issue in upcoming versions of JCO?
    regards Samir

    Hi,
       Check Below links
    1) How To Analyze Performance Problems JCO
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3fbea790-0201-0010-6481-8370ebc3c17d
    2) How to Avoid Memory Leaks 
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c3e598fe-0601-0010-e990-b8622840c8c2
    Salil...
    Edited by: salil chavan on Jun 2, 2009 5:21 AM

  • Find memory leak

    Hi All ,
    In our SAP application server (Solaris 10 X86 running on hardware HP ProLiant BL685c G5) physical memory available is day to day decreasing drastically. We suspect, there is a memory leak.
    Could you please let us know how to find memory leak in Solaris.
    Regards,
    Rajesh.

    Hi Rajesh
    Memory leaks have a large number of possible causes, including:
    •Unsupported hardware or software
    •Custom Scripting
    •Misconfiguration
    •Third party hardware and software issues
    The prstat command can be used to gather basic performance data to help identify if there are any processes consuming a large amount of memory. For example, the data below is sorted by the SIZE column. SIZE is the total virtual memory size of the process:
    prstat -s size
    If you are experiencing some of the symptoms described above or if you suspect a memory leak, it is particularly important that performance data is captured so the memory leak can be confirmed. It is important to gather at least the following pieces of information:
    •Process ID (PID)
    •Size of the process
    •The executing command
    •The timestamp information showing exactly when the data was captured.
    while true
    do
    for pid in `cat pids`
    do var=`date|cut -d' ' -f4`
    echo "$var :\c" >> ps.log.$pid
    ps -eo pid,vsz,rss,pcpu,args | grep $pid |grep -v grep >> ps.log.$pid
    done
    sleep 30
    done
    You could check the memory utilisation details through
    #mdb -k
    ::memstat
    kmastatRegards
    Sadiq

  • Memory Leak in Swing.

    Hi!
    I have Real time application(JDK1.3). After each 30 sec it brings data from backend &puts into JTable.
    But it works only for 6 to 8 hours. After that it gives error
    in JVM.dll.
    I'm using 3 threads. Main code is something like this.
    public class Main extends Thread{
    public void run(){
    while(true)
    try{
    Testtable.Update();
    Thread.sleep(30000);
    }catch(InterruptedException e)
    { System.out.println("error occured");}
    TestTable is a public class which extends AbstractTableModel. This is a inner class of Main class.
    I have checked memory usage of java.exe. It increases
    usage after sometime.
    How to detect memory leak? Do have to do changes in my code? "vector" usage is more in this program.
    Thanks,
    Sujata.

    Hi,
    For cellrendering I have following code.
    public class MultiLineHeaderRenderer extends JList implements TableCellRenderer{
    public MultiLineHeaderRenderer() {
    try{
    setOpaque(true);
    setForeground(UIManager.getColor("TableHeader.foreground"));
    setBackground(UIManager.getColor("TableHeader.background"));
    setBorder(UIManager.getBorder("TableHeader.cellBorder"));
    ListCellRenderer renderer = getCellRenderer();
    ((JLabel)renderer).setHorizontalAlignment(JLabel.CENTER);
    setCellRenderer(renderer);
    }catch ( Exception err){
    TeCILog.logTrace( this, "Failed to construct MultiLineHeaderRenderer." );
    TeCILog.logError( this, err );
    public Component getTableCellRendererComponent(JTable table, Object value,boolean isSelected, boolean hasFocus, int row, int column)
    setFont(table.getFont());
    String str = (value == null) ? "" : value.toString();
    BufferedReader br = new BufferedReader(new StringReader(str));
    String line;
    Vector v = new Vector();
    try {
    while ((line = br.readLine()) != null)
    v.addElement(line);
    br.close();
    }catch (IOException ex) {
    ex.printStackTrace();
    } catch(Exception err){
    System.out.println("error" + err );
    setListData(v);
    return this;
    private ListCellRenderer renderer = null;
    Does this is causing leakage?
    Sujata

  • Best Practices for EJB--memory leak avoidance

    I an researching a memory leak. From what I can tell, we do not want to put any instance variables at the class level. This would incur a memory leak when the ejb containers creates the ejb.
    I am wondering if there are any more 'best practices' with EJBs that prevent memory leaks. A good site would help me too
    Russ

    Thank for your reply.
    You are right. I was referring to stateless session
    beans.
    What I was thinking was the following:
    1. Making parameters final unless the parameter
    r state is changed inside a method.Won't help with memory leaks. There are benefits for an object being immutable, but I don't think that it eliminates the possibility of the object being leaked.
    2. All instance variables in stateless session beans
    s should be set to null upon ejbPassivate and
    ejbRemove operations. The variables should be
    populated on ejbCreate and ejbActivate.Optimizing compilers don't need the hint of setting the reference to null. I don't think that helps, but I'm not 100% certain.
    3. Before throwing an exception at the session bean
    level, clear up all the instance variables by setting
    them to null.Shouldn't scope make it clear to the GC that the objects aren't needed? If they're all primitives, how does this help memory leaks?
    I am using a profiler to identify the objects still
    being held onto once GC, but I was hoping others with
    more experience than I would share some of their tips
    on how they avoid memory leaks.I don't know where you're getting these tips, but I don't think they're helpful.
    Collections and Singletons would be the places where I'd look. If you add a reference to an object that holds onto it in a collection and never lets go, the GC won't reclaim it.
    Singletons aren't cleaned up, because their instance is static. Anything the Singleton refers to won't be cleaned up unless the Singleton relinquishes the reference.
    Look for things like that. I think they matter more.
    %

  • How to root out memory leak with  Java JNI & Native BDB 11g ?

    We are testing a web application using the 32-bit compiled native 11g version of BDB (with replication) under 32-bit IBM 1.5 JVM via JNI under 64-bit RedHat Linux. We are experiencing what appears to be a memory leak without a commensurate increase in Java heap size. Basically the process size continues to grow until the max 32-process size is reached (4Gb) and eventually stops running (no core). Java heap is set to 2Gb min/max. GCs are nominal, so the leak appears to be native and outside Java bytecode.
    We need to determine whether there is a memory leak in BDB, or the IBM JVM or simply a mis-use of BDB in the Java code. What tools/instrumentation/db statistic should be used to help get to root cause? Do you recommend using System Tap (with some particular text command script)? What DB stats should we capture to get to the bottom of this memory leak? What troubleshooting steps can you recommend?
    Thanks ahead of time.
    JE.
    Edited by: 787930 on Aug 12, 2010 5:42 PM

    That's troublesome... DB itself doesn't have stats that track VM in any useful way. I am not familiar with SystemTap but a quick look at it seems to imply that it's better for kernel monitoring than user space. It's pretty hard to get DB to leak significant amounts of memory. The reason is that it mostly uses shared memory carved from the environment. Also if you are neglecting to close or delete some object DB generally complains about it somewhere.
    I don't see how pmap would help if it's a heap leak but maybe I'm missing something.
    One way to rule DB out is to replace its internal memory allocation functions with your own that are instrumented to track how much VM has been allocated (and freed). This is very easy to do using the interfaces:
    db_env_set_func_malloc()
    db_env_set_func_free()
    These are global to your process and your functions will be used where DB would otherwise call malloc() and free(). How you get usage information out of the system is an exercise left to the reader :-) If it turns out DB is the culprit then there is more thinking to do to isolate the problem.
    Other ideas that can provide information if not actual smoking guns:
    -- accelerate reproduction of the problem by allocating nearly all of the VM to the JVM and the DB cache (or otherwise limit the allowable VM in your process)
    -- change the VM allocated to the JVM in various ways
    Regards,
    George

  • How to define the memory leak in stability test

    Hi
    Usually, we run our system with 70% CPU load for 72 hours for stability test (on solaris 10), because some plugin of our system is using mtmalloc, and we use prstat to monitor the memory of each plugin. But because of the complex memory usage of our application, we don't know when the application will use the Max memory, and because of the "mtmalloc", the memory showed by "prstat" will not released but continually increased.
    So fro the test point of view, there is the risk of memory leak, but actually, there may be no memory leak, so my question is how to define the memory leak in such condition.

    kevin wrote:
    Thank you for the input and all the info.
    isn't java heap the same as memory allocated to the java process in my weblogic
    starup script ?The heap is sized by the -Xmx and -Xms parameters you pass on the java
    command-line. The permanent generation is separate.
    >
    let me also download jprobe and try to run it and see what it gives me.
    I'd start by running with -verbose:gc. I'd want to know whether you're
    running out of heap or permgen space.
    -- Rob
    kevin
    Rob Woollen <[email protected]> wrote:
    Unfortunately memory leaks are not fun to track down even with tools.
    I'd first suggest determining whether you're running out of space in
    the
    permanent area (where classes are loaded), or you've exhausted the java
    help space.
    I'd start by adding -verbose:gc. Look at the gc messages right before
    you hit the OutOfMemoryError. If there's plenty of space left, I'd
    suspect you're running out of perm space. Search these newsgroups and
    the web for MaxPermSize, and you should see plenty of info.
    If you're running out of java heap, tools like jprobe and OptimizeIt
    are
    helpful. If you can tell me a little more about your application and
    how you're testing it, I can offer some more tips.
    -- Rob
    kevin wrote:
    Iam new to JAVA and weblogic. I have an application that runs out ofmemory time
    and again.
    please let me know how to pin point this problem and moreover, howto interpret
    or understand that there is a problem. I have downloaded JPROFILE tool,but it
    is very confusing to understand what is goin on in this tool.
    If somebody can let me know how to interpret and understand the memoryleak, that
    will be great !!!
    thank you.

  • How Do I identify a Memory Leak?

    I know this is not enought information but...
    My application used 3 hashtables in a Data object to store application data. I retrive this data from an XML file. I also download XML and merge it into andother XML file. Some of these hashtables contain object that contain more hashtables.
    I am trying to use JProbe Profiler to find the leak. I notice the memory increases when I load the data into objects and put them into hash tables. I also notice an increase when I am merging newly downloaded XML into the current XML data. I am useing Nodelists and NOdes to get the data.
    Does anyone have any tips or suggestion on how to find a memory leak?
    Thank you,
    Al

    7 MB of XML file, loaded into a DOM? You realize, of
    course, that DOMs are data structures that take up
    memory, too, right?Yes I do. I load it into DOM then go through the Document and put the XML data into a custom file format (seialized objects). The data is sent from the server in the form of XML.
    There's your problem. If you load X MB into memory
    and keep it around as long as your application is
    running, that's not necessarily a "leak". Yeah I realized this but it seems that if I load 7MB of my objects into hashtables my memory usage shouldn't increase by 30MB. I just assumed it would stay around 10MB.
    The real issue is trading memory for CPU. If keeping
    them in memory is crashing your app with OOM errors,
    by all means just keep those objects in memory for as
    long as you need them and then let the GC clean them
    up. Don't put them in a Map, just let them have a
    narrow method scope. Recreate them every time you
    need them. Yes I'm beginning to see the light.
    I'm sure you're thinking, "But recreating them will
    cost CPU and slow down my app!" Yes, that's why it's
    a tradeoff between memory and CPU.
    Do you really need the whole document in memory at
    once? If you're just cherry picking a few values out
    of it, maybe you can use a SAX parser instead of a
    DOM.
    No I don't need all that data at once.
    >
    Either you're screwed or you need to rethink this.
    You'd better hope that it's really not needed at
    every moment for every client.After rethinking, I'm going to keep the serialized data in the file until I need it. Rather than searching through a hashtable for the object I want I will search the file.
    What are your JVM settings for -Xms and -Xmx? Maybe
    increasing those will do the trick.I did increase them and it helped a little, but I can still get a OutOfMemoryError if I try.
    Are you sure these are the culprits? Have you
    profiled the app to see if there are other sources of
    leaks?Yes I have been profiling the application. It seems that there is a memory leek. I am just having trouble identifing it. I know the memory increases at 2 points. When I load the XML data into the DOM and when I load the DOM into my Custom object and then into the Hashtables.
    Last resort? Buy more physical memory. It's cheap.I think I am going to keep unused data out of memory and access it form a file. After I make this change I think my memory usage will drop alot. I will profile again after I have this change made to see if there is a memory leak.
    Thanks for you help,
    Al

Maybe you are looking for

  • Installing Premiere Elements | Error DW020?

    Trying to install Premiere Elements got this Error. cpsid_90243r4: Error DW020 or DW050 occurs during installation - Creative Suite 5.5, Flash CS5.5, Flash Builder 4.5 Click here for details and corrective actions related to this issue. I guess it me

  • CUPC video call issue

                       Hi there,                              i am facing the issue ,CUPC 8.5 video call is not working ..i have cucm 8.0. and CUP 8.0 ..any help will be higly appreciated.. Thanks Shib

  • Trying to learn Spry Framework Ajax

    So I am trying to learn how to use Spry Framwork for Ajax; which I downloaded from http://labs.adobe.com/technologies/spry/ Does anyone know if this some how plugs into Dreamweaver 8 or if I wish to use it, "the Photo Gallery to be specific", that I

  • Is this as good as it gets?

    Sorry if you've heard this before, but i'm rather disappointed with my new pc... i5-3570K overclocked 30%, 12 GBram T1 xmp, couple of 500GB Blue drives. I'm trying to apply some stabilization to some old DV Type 1, Pal, 702x576, clips. And a 4 minute

  • Can't buy/download anything from the Mac App Store

    Anyone has the problem of not being able to buy anything from the Mac App Store. It is extremely annoying. It does not show any error messages. When I click on the "Buy App" icon it does't go anywhere. its so annoying and disappointing. Tried it from