Memory Leak Doubt

Hi All,
I have a doubt about memory leak in Java.
Consider the following code.
public class Class1 implements java.io.Serializable
private static java.util.ArrayList known = new java.util.ArrayList();
private final String name;
private final int value;
protected Class1(String name, int value)
this.name = name;
this.value = value;
synchronized (Class1.class)
known.add(this);
Now, if i create an instance of the Class1 in my code and use it in a method.
So once the method ends, the instance of Class1 shoud get garbage collected by GC right???
But it is not happening, becoz the same instance is added to a static arraylist in the Class.
Is the above phenomenon an example of Memory Leak?
Please clarify it.
Thanks,
Ravi Ambati

Can i say that this is a bug in Java 1.5?What you posted? No, you can't call it a bug. What you posted only shows instance references being placed into a static array. What you failed to posted is whether or not anything actually removes them, like a dispose method which is explicitly called by some other class as part of a controlled usage pattern.
If the code is creating lots of instances and never removing them from the list, I would call that a memory leak, so it's a bug. If it has a means to remove the items from the list, then it's not a memory leak. But there could still be a bug in that the disposal method may not always get called when it should. But that would be a bug elsewhere.
I've done applications before that do exactly the same type of thing, the constructor adds itself to some singleton manager class to keep track of the objects. But when I don't need them anymore, there's a method to dispose the object, which includes removing itself from the manager class.

Similar Messages

  • Memory Leak in Java Server

    Howdy Folks- I wrote a server monitor in java, which I was expecting to run for months at a time without restarting. Apparently there is some slow memory leak which results in an OutOfMemoryError after a few weeks. It's in a production system, so I can't readily add debug statements to the code, and the OutOfMemoryError apparently screwed up the logging, so I didn't get a stack trace in my logs, just an "OutOfMemoryError" went to standard out.
    I'm assuming the problem lies in the code, specifically probably some discarded reference that is not being properly garbage collected? I am using a few different ArrayLists to store some historical information, and I call clear() on these frequently. Is there any known issue with ArrayList or HashMap that the "clear()" method doesn't result in garbage collection of the objects that were in it? I am also doing a "remove(int)" sometimes as well. Any chance the objects cleared or removed would not be garbage collected?
    thanks
    Bleu

    Howdy Folks- I wrote a server monitor in java, which I
    was expecting to run for months at a time without
    restarting. Apparently there is some slow memory leak
    which results in an OutOfMemoryError after a few
    weeks. It's in a production system, so I can't
    readily add debug statements to the code, and the
    OutOfMemoryError apparently screwed up the logging, so
    I didn't get a stack trace in my logs, just an
    "OutOfMemoryError" went to standard out.Are you even attempting to catch Errors? Catching Exceptions will not help with this. It should print the stack trace. When it OOMs it doesn't mess up what's already allocated, it just can't allocate more.
    I'm assuming the problem lies in the code,
    specifically probably some discarded reference that is
    not being properly garbage collected? Most likely, there are references that are never being cleared in your code. Without seeing the code or at least having a better description, I don't think anyone here can help you. Can you set up a test senario and use an Optimizer to see what's going on?
    I am using a
    few different ArrayLists to store some historical
    information, and I call clear() on these frequently.
    Is there any known issue with ArrayList or HashMap
    that the "clear()" method doesn't result in garbage
    collection of the objects that were in it? Not that I know of, no. I doubt that is the problem.

  • Memory leak with fieldpoint and labview

    I have an application which is showing an issue of a memory leak.  The application does several things, but the part that seems to be causing the trouble is related to use of Fieldpoint VIs.  The application reads individual AI channels on a Fieldpoint AI-110 (10 channels, where the set of channels is measured once per second)  I have attached the code related to this.  The memory leak is quite large (~1.5GB in 24 hours of operation).
    I am using LabView 7.1, and Fieldpoint 4.1.  The parent application which uses the attached code is a stand-alone application.  The operating system is Windows 2000.  Fieldpoint communication occurs over a RS-232 link.
    Thanks in advance,
    Andy
    Attachments:
    FPAI100_meas_voltage.vi ‏62 KB

    Hi Andy,
    I did not see anything fundamentally wrong with what you wrote, but there were
    a few things that I think could be used to be changed.  However, there
    were a few things that I did modify that might make a bit of a
    difference.  In your application you were using sequences and a bunch of
    local variables.  Since LabVIEW is based upon data flow, you can control
    the sequence of execution by making data dependencies and simply wiring one
    thing to the next.  By simply using LabVIEW the way it is meant to run I
    was able to completely remove the sequence structure and also eliminate the use
    of all of the local variables, all while having the exact same execution order. 
    It could be that the local variables were causing the memory leak that you
    noticed, but I really doubt they could be the cause of such a large leak. 
    I really think there is probably something else going on in the application
    because from what I saw from this bit of code there really is no way that it
    would have such large problems.  Users use the FP commands daily without
    any problems, so most likely these are not the root of the problem.
    Go ahead and try the modified code and see if you can implement similar local
    and global variable reducing techniques throughout your application. 
    Hopefully that will help reduce some of the memory leaks you are seeing. 
    Typically the largest cause of an apparent memory leak really occurs from
    building an array within a loop, so make sure you don't have any situations
    where that occurs in your code either.
    Regards,
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments
    Attachments:
    724727-FPAI100_meas_voltage.vi ‏56 KB

  • Memory Leak with ObjectInputStream - Any takers....

    Hi,
    Anyone see how to remove the memory leak problem in my objectInputstream ? Increases during the while loop...
    private static String message = " ";
    while(true) {
                        try {
                            message = (String) sharedRef.iStream.readObject();
                            System.out.println("Length of Message: " + message.length() );
                            message = null;
                            System.gc();
                            sharedRef.memchk();
                        } catch ( Exception e ) {
                            //sharedRef.screen.setText(buf.toString());
                            //sharedRef.screen.append("Connection closed...");
                            //sharedRef.closeConnections();
                            //this.stop();
                        }Output.... (example):
    2006-04-10 16:11:51 +++ Free: 66067688
    Length of Message: 92
    2006-04-10 16:11:52 +++ Free: 66067448
    Length of Message: 92
    2006-04-10 16:11:52 +++ Free: 66067272
    Length of Message: 92
    2006-04-10 16:11:53 +++ Free: 66067032
    Length of Message: 92
    2006-04-10 16:11:53 +++ Free: 66066792
    Length of Message: 92
    2006-04-10 16:11:54 +++ Free: 66066552
    Length of Message: 92
    2006-04-10 16:11:54 +++ Free: 66066376
    Length of Message: 92
    2006-04-10 16:11:56 +++ Free: 66066136
    Length of Message: 92
    2006-04-10 16:11:57 +++ Free: 66065896
    Length of Message: 92
    2006-04-10 16:11:57 +++ Free: 66065656
    Thanks

    Object streams cache objects they've read and written. This is so that you don't have to write the same object multiple times if it's referred to multiple times. Let's say that both obj1 and obj2 have references to obj3. When you write obj1, it will also write obj3, and the OOStream will cache both obj1 and obj3. Later, when you go to write obj2, it will notice that it has already written obj2, and not write it again--it will just write a reference of sorts to indicate which already-written object obj2 points to as a member.
    I would imagine OIStream must do the same thing. It would have to cache objects it's reading, so that when a "reference" (in the general sense) to a previous object appears, it can behandled properly.
    On the OOS side, you can flush the cache by calling reset(). I doubt you can do anything about it in the OIS side. Input's behavior here must be driven by what was output.

  • Memory Leak - GC scope

    Hi,
    I have a pervasive memory leak in my server application. I have used JProfiler to track it down and indeed after 10 or so hours of execution I can see clearly the Java classes which are increasing in count. For my application they are (in order of total memory size used):
    byte[]
    <class>[]
    String
    QueueLink(custom class)
    Knowing where my system leaks memory is nice, but on trawling the code I cannot really see why it really leaks and therefore am unable to fix it. One thing I do not quite get about Java is the garbage collector scope. If I have a loop, like so below:
    while (true)
    Object o = new Object();
    ...do something with 'o'
    then for every loop iteration 'o' is initialize to a new Object. But the old reference of o (from the previous iteration) is for all intents a purposes gone. BUT, does this get collected by the GC or does it only get collected when the scope leaves the while loop? If the latter then UNTIL the loop terminates I will "leak" memory, which would go part way to explaining my problem.
    Any ideas, any suggestions on how I can fix my leak(s)?
    Regards,
    NC

    ... then for every loop iteration 'o' is initializeto a
    new Object. But the old reference of o (from the
    previous iteration) is for all intents a purposes
    gone. BUT, does this get collected by the GC ordoes
    it only get collected when the scope leaves thewhile
    loop?It has nothing to do with variable scope in this
    case. The object that 'o' used to reference is no
    longer reachable (unless something else in that loop
    made another reference to it, such as adding it to a
    collection which is still reachable), so it is
    eligible for GC.The question is, will it be GCed.
    I remember hearing a few years back that the VM--or certain VMs--might not collect any eligible local variables until after the method completes, or something to that effect. If so, then an infinite while(true) { new Object(); } loop will exhaust the heap rather quickly. Even if that was true back then, I doubt it's true of Sun's VM today.

  • Is this a memory leak issue ?

    We are using Jdev10g + BC4J + Struts + JSP to build our enterprise application,
    but when the application running some days in our Application Server(RedHat AS3-86, with 4GB RAM), the memory consumed is serious ! we doubt and worry
    about maybe our application suffer the memory leak problem, so we want to know have the command to find out whether our application caused the memory leak
    issue and which program is the major murderer for memory.
    In EM console , the memory utilization chart have big memory consumed in "other" legend ? the "other" legend is mean what ? I cannot find the consumer process in system level through ps command ? it seems disapear ! but after I reboot the server , the "other" legend is clear !

    The second scenario is, as we perform some deployment activity on 10g, the memory usage chart shows a sharp consumption of memory about 1.5GB .the loss memory almost be display in "other" legend chart !
    Please give us some advice , thanks in advance

  • Possible memory leak in TagFileTagInfo class

    Hello,
    Our application is experiencing a memory leak in Weblogic, which is not happening in other application servers.
    We are running Weblogic server 10.3 using the distributed jsf 1.2
    Eclipse Memory Analyzer clearly points to TagFileTagInfo class as retaining a Map which holds all the memory. Furthermore, it shows that said map (called _tagFileInfoMap) is holding FileTagFileInfo class instances.
    It could be possible that our application were doing something wrong, and that would cause the described behavior, however I doubt that as the other application servers where our application is deployed do not present this problem.
    Any suggestion on how we should proceed to fix this problem?
    Thanks
    Juan

    Hi,
    Was this issue resolved by using wlappc?
    Were you able to compile the tag files with wlappc? I tried compiling the jsps using wlappc, but it seems that the tool expects an ejb-jar file.
    Any help on this is greatly appreciated.
    Thanks
    Hareesh

  • Memory leak - Node clean up?

    Hey guys,
    I'm running into a memory leak and was reading some other threads where people were having their own memory leaks. Is there a way through NetBeans to track memory usage or something to figure out what is consuming memory? My memory leak sounds similar to this gentleman's: [http://forums.sun.com/thread.jspa?threadID=5409788] and [http://forums.sun.com/thread.jspa?threadID=5357401]
    Setup:
    I have a mySQL database call that returns a bunch of results and in the end converts each record into its own custom node which then gets put into a sequence, which is then given to a listEventsNode (a custom node VBox) and finally put on the stage. As a note each custom node has its own animations, events, images, and shapes.
    listEventsNode gets its list of custom nodes from a publicly accessible sequence variable where its contents is simply cleared and new nodes are added by the next MySQL search. I cleared the eventSequence by using delete myCustomNodeSequence.
    I even go as far as setting the same sequence null (myCustomNodeSequence = null;). This unfortunately doesn't make any difference in terms of memory usage. java.exe will reach 100MB then crash.
    the listEventsNode is bound with eventSequence, this is to ensure that changes to the sequence of custom nodes are immediately reflected in the Vbox (listEventsNode).
    ListEventsNode is on the main stage and there is only one instance of it, but what changes is the content in the eventSequence. Even if I clear the contents of the eventSequence, it doesn't appear to "clean up" the memory.
    The way I'm doing it is probably breaking every rule in the book. I should probably make it so listEventsNode is its own object which isn't bound to any external variables (such as eventSequence) and in the event a new search takes place I simply delete the listEventsNode and when a new search is complete, it re-adds the node to the scene. Am I on the right track here?
    Is there a good "best practices" for JavaFX? For example, a typical mistake that would cause a node to "recreate" itself over and over again in memory when the programmer may have thought it was simply being "written over"? Does this make sense? Because I have a feeling that my application is not deleting the custom nodes that were created for the eventSequence and even if the eventSequence is "deleted" and re-assigned with new custom nodes, the original or previous custom nodes are still residing in memory.
    Let me know if you need to see the source or any logs/readouts from NetBeans during execution if this will help.
    Thanks for taking the time to read this.
    Cheers,
    Nik.

    Your heap usage looks pretty typical. In scenario 5, I think you are simply running out of memory. I doubt its a leak inside the javafx runtime (although it could be).+
    I think you might be right. It's running out of memory and I may have to increase the heap size.
    Say that my application legitimately needs more memory to operate, and I need to increase the heap size. How does this work if you have a fully deployed application? Is the heap size information built into the application itself so that when the jvm runs the application, it allocates the appropriate amount of memory? I've increased the heap size from 64mb to 128mb, and I added many many nodes and I still crapped out when I hit the 128mb ceiling. I changed it to 512 and I added a TON of nodes (when you click a node from the VBox, it adds a miniature version of the node to the scene graph) and I'm just under 200MB. I plan on setting a cap to how many concurrent additional nodes can be placed on the scene graph, which will help.
    If you deploy this as is, how does the application utilize memory if you've adjusted the heap size? Or is this specific to the IDE only?
    Do you know what objects are on the heap? Can you compare what objects are on the heap from one scenario to the next?+
    Where can I find this information in NetBeans profiler?
    Do you have a lot of images? Are they thumbnails or are they images scaled down to thumbnail size?+
    Actually, yes I am using a scaled down thumbnail size of the original image. The original image files are PNG format, 60x60 pixels, and about 8kb in size. I simply use the "FitWidth:" property to scale the image down. I was doing some more reading before I went to bed and I was going to use an alternative way to scale the image down. By simply doing this, the initial heap usage off the 500 node search went down form 44MB to 39MB. It's still slower on consecutive searches versus the first, but it's stable.
    Edit: I've used the width: property to downsize the image and it looks like I'm not running into that heap crash as fast but this poses a problem where I need to have the full size of the image available when a custom node is selected. What's the best way of doing this? I should probably store the image location in a string and recreate the image when I need it in full size since there is only one full size version of it on the screen at a given time. I've also completely disabled the addition of a picture in my custom node; it appears these images don't take up a lot of space since they are very small. I save an additional 3-5MB in heap space if I completely disable the pictures and have just the nodes themselves. Each node has animation effects (i.e. fading in/out of colors, changing of color if selected). Although the class itself is pretty dang long in comparison with any other classes I have.
    Are you clearing the nodes from your scene content before the search or after? If after, are you creating the new nodes before clearing out the old?+
    Yes, I have a function that reassigns the stage.scene.content sequence omitting the custom vbox that houses the list of custom nodes prior to the next search. The "cleanUp()" function is called prior to the insertion of the new custom vbox.
    It might be useful to turn on verbose garbage collection (-verbose:gc on the java command line) just to see what's happening in gc.+
    What is this exactly? I tried putting in System.gc() but I'm not sure if I'm seeing any difference yet.
    Edit: Actually, I've placed System.gc() after I run my cleanUp() function and I'm noticing the heap usage is more conservative. Seems to clear more often than it did before. But yes, the underlying problem of my running out of memory is to be looked at.
    You might also (just as an experiment) force garbage collection between your searches.+
    This seems to work well with smaller result sets. However, a search that produces over 500 custom nodes in a custom VBox uses more than half of the available heap size, so the next time it tries to do the same search it just crashes like you mentioned in your first point. The memory simply runs out. What I don't get is if I "delete" the custom vbox prior to inserting it, the memory doesn't seem to be released immediately. From what I'm reading about the garbage collector, it doesn't exactly do things in a prompt fashion.

  • Avoid Bug 7146375 ORA-4030 MEMORY LEAK IN (Xml generation) in oracle 10g

    Hi All,
    I have to generate an xml from database which contains around 4 lac records. I had written a query using XmlSerialize and XmlElement.
    It does run properly for records less than 2 lacs.
    But when the record count goes above 2 lacs..it is throwing the following error -
    { ORA-04030: out of process memory when trying to allocate 1032 bytes (qmxlu subheap,qmemNextBuf:alloc)
    ORA-06512: at "SYS.XMLTYPE", line 111!}
    For the above error - I have tried increasing pga from 480M to 800M, but still we are getting the same error.
    After researching i found out -
    Cause
    This is caused by the following bug:
    Bug 7146375 ORA-4030 AND MEMORY LEAK IN SESSION HEAP: "KOH DUR HEAP D"
    Solution
    Bug 7146375 is fixed in 11.2
    So i tried out the query in another a db which has 11g installed and my query runs perfectly fine for records of upto 4 lacs.
    But since we have oracle 10g on our clients machine, are there other ways to achieve this XML generation other than this?
    Thanks.

    913389 wrote:
    After researching i found out -
    Cause
    This is caused by the following bug:
    Bug 7146375 ORA-4030 AND MEMORY LEAK IN SESSION HEAP: "KOH DUR HEAP D"
    Solution
    Bug 7146375 is fixed in 11.2
    So i tried out the query in another a db which has 11g installed and my query runs perfectly fine for records of upto 4 lacs.
    But since we have oracle 10g on our clients machine, are there other ways to achieve this XML generation other than this?I doubt it. If Oracle have investigated and created a bug report that says the solution is to upgrade to 11.2, then that's the answer, otherwise they would indicate that a particular 10g patch set can also be used.

  • Whether our application caused the memory leak

    whether have the command to find out whether our application caused the memory leak !
    We are using Jdev10g + JHeadstart(Release 9.0.5.1, BC4J + Struts + JSP) to build our enterprise application,
    but when the application running some days in our Application Server(RedHat AMD64, with 8GB RAM), the memory consumed was growth seriously in production environment (one OC4J instance will caused almost 2G memory ulilization after running 2 days) that is caused us to restart the instance each day ! we doubt and worry
    about maybe our application suffer the memory leak problem, so we want to know have the command to find out whether our application caused the memory leak
    issue and which program is the major murderer for memory.

    Ting,
    Unfortunately there is no 'command' that will show you the location of a memory leak. First I would scrutinizing your code for any obvious 'leaks'. Then, you should obtain some statistics about the usage of your system. One important aspect is how long a HttpSession usually lives. If you have thousands of users that stay online the entire day and never 'time out', and if you have users on the system 24 hours a day, then the sheer number of HttpSessions might be a problem.
    JHeadstart 9.0.x tends to have rather 'heavy' session objects. This can easily be solved by adding some actions to clear up DataObjects and DataObjectSets of previous 'Groups' when entering a new Group. A good place would be between the 'DynamicActionRouter' and the 'ActionRouters'. Just before entering the 'EmployeeActionRouter', you could remove all DataObjects and DataObjectSets that might be left on the Session by actions of the other ActionRouters.
    Also it would be interesting to see if the garbage collector can do its thing when the system is less busy. For instance, if your application has a smaller load during the weekend, what is the memory usage on Sunday at midnight compared to, say, Friday at noon. Has the memory load dropped consistently with the decreased number of online users, or does too much memory stay allocated? If so, then there's more going on than just HttpSession objects.
    If all this does not lead to a solution, I suggest using a profiling tool such as OptimizeIt to investigate the memory usage of the application in detail.
    Kind regards,
    Peter Ebell
    JHeadstart Team

  • Find out whether our application caused the memory leak

    whether have the command to find out whether our application caused the memory leak !
    We are using Jdev10g + BC4J + Struts + JSP to build our enterprise application,
    but when the application running some days in our Application Server(RedHat AS3-86, with 4GB RAM), the memory consumed is serious ! we doubt and worry
    about maybe our application suffer the memory leak problem, so we want to know have the command to find out whether our application caused the memory leak
    issue and which program is the major murderer for memory.

    The second scenario is, as we perform some deployment activity on 10g, the memory usage chart shows a sharp consumption of memory about 1.5GB .the loss memory almost be display in "other" legend chart !
    Please give us some advice , thanks in advance

  • Who can help me? is it a issue of Memory leak?

        First , I have a poor English, sorry!
        I have a project , and the project has two States, click the button to change the State.
    I run the Application, I can see the memory is 39MB. After I change the State several times,
    and the memory increases to 43MB.
        My Application has a s:TextInput and s:TextArea, when I change the focus between them,
    I find the memory increase to 55MB, and continue increasing if you do the same action.
    In my surprise, if I use mx:TextInput and mx:TextArea, the problem is disappeared.
        I doubt this is a memory leak, I test the TourDeFlex, and it has the same problem.
    My environment is Flex SDK 4.1, and air 2.6.
      Finally I paste my Source here:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:ns1="*" currentState="S2"  height.S1="455">
    <fx:Script>
      <![CDATA[
       protected function button1_clickHandler(event:MouseEvent):void
        this.currentState="S2";
       protected function button2_clickHandler(event:MouseEvent):void
        this.currentState="S1";
      ]]>
    </fx:Script>
    <s:states>
      <s:State name="S1"/>
      <s:State name="S2"/>
    </s:states>
    <fx:Declarations>
      <!-- 将非可视元素(例如服务、值对象)放在此处 -->
    </fx:Declarations>
    <s:Button includeIn="S1" x="47" y="318" label="按钮" click="button1_clickHandler(event)"/>
    <s:ComboBox includeIn="S1" x="47" y="84"/>
    <mx:DataGrid includeIn="S1" x="47" y="151">
      <mx:columns>
       <mx:DataGridColumn headerText="列 1" dataField="col1"/>
       <mx:DataGridColumn headerText="列 2" dataField="col2"/>
       <mx:DataGridColumn headerText="列 3" dataField="col3"/>
      </mx:columns>
    </mx:DataGrid>
    <s:TextArea includeIn="S2" x="52" y="71"/>
    <s:TextInput includeIn="S2" x="52" y="25"/>
    <s:Button includeIn="S2" x="52" y="258" label="按钮" click="button2_clickHandler(event)"/>
    </s:WindowedApplication>

    You can use the profiler to determine if there is a leak.  Because of the
    way Garbage Collection works, memory can grow if it gets fragmented, but
    will eventually reach an upper limit if there is no leak.

  • Full Motion Video - memory leak?

    Good afternoon.
    I am using captivate 1.01.1418.1418 to record and present
    standalone demos of rich client web technologies. The default
    capturing techniques just don't cut it, so I need to record the
    entire demo in full motion video.
    What I have noticed is that when you edit the video AND ALSO
    when running the published demo using either stand-alone or swf
    object methods that there is a huge memory leak. I am talking to
    the magnitude of 20-25 meg / second while displaying full motion
    video.
    My latest presentation is 22 slides where 3 of them are short
    full motion video clips recorded at 1024x768 with no audio. The
    clips are between 30-90 seconds.
    The generated output exe is 6 megs and if I generate it with
    all compression off it is 11 megs. When I run it, my memory usage
    goes to 1.7 GIG of Physical Memory and over 2 GIG of Virtual Memory
    in use. The movie playback then turns solid red and my machine
    hangs up until I can manage to kill the playback.
    Is there a known issue with full motion video and memory
    leaks? I can understand if it took more memory to run it, but using
    3+ gig of RAM to play a 10 meg file? Something sounds off to me.
    I had purchased this product to record and display full
    motion demos and so far it has not been able to meet the needs it
    promised to deliver.
    Any help anyone provides is greatly appeciated.
    Please respond here and/or email me at
    [email protected]
    Thanks in advance for your time.
    -Ray
    P.S. I remember seeing the same behavior on my trial version
    of Captivate 2, however, my trial has expired and I cannot see if
    the leak is of the same magnitude.

    Hi Ray,
    You are experiencing "normal behavior" for the use you are
    putting Captivate to. It was never designed as a full motion video
    capture tool. I won't argue whether or not the marketing people
    ever said it was capable of doing what you say you bought it to do,
    but I really doubt they would make a claim that everyone knows is
    not true ... if you can find something official from Adobe
    asserting that, I'd sure be interested in seeing it.
    The full motion feature was intended to be used to
    demonstrate 2-3 second drag-and-drop operations, or use of a
    scroll bar action of about that duration. In addition, you stated
    you are capturing at 1024x768 size, which is an image of truly
    gigantic proportions - adding to the full motion load you are
    already throwing at the product. Could it be that another product
    is better suited for what you want to do? I'd consider that
    seriously because you are asking more of Captivate than I believe
    it can deliver on anything but a machine designed for 2015
    processor speeds with infinite resources.
    It is especially sad that you own and used Captivate 1.0.1,
    then spent an additional 30 days using the Trial version of
    Captivate 2.0 ... but are just now finding it doesn't do what you
    thought it should do. Again, sorry for your trouble.
    .

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

Maybe you are looking for

  • Unable to register the service in OWSM

    Hi All, Registered 4 services successfully While registering another services in the OWSM i am facing the below error Failed to add service because of the following reason: Failed to add default policy Refer logs for additional information Use your b

  • Usage of intersect in pl/sql .. !

    Hello alll...... I have got a small requirement using intersect operator in pl/sql. The problem is .. While executing the sql statement using intersect operator in sqlplus .. it is executing fine and the result set is shown .. but when the same state

  • Read H.264 (.mp4) into labview. Anyone?

    Hi all... So i am really tired of uncompresssing .mp4 videos with third part tools so that i can read them in using ni visions avi functions.  Has anyone figured out a way to read mp4 files in directly to labview?  I saw this DirectShow .NET LabVIEW

  • Labview, Change the phase between 2 signals dynamically

    Hello, I'm working on a big VI , and for testing my VI I have some controls.  A part of my VI is to generate 2 sine signals with the same amplitude and frequency and a phase difference between thoses 2 signals. My example is quite simple but very sim

  • Applications Adapter: How to integrate BPEL with Apps?

    Hi all, I am trying to integrate a BPEL Process with Oracle Applications. Can anyone share some ideas/documents/references for this. Thanks!!