Distributed objects leak memory

When passing this C struct
NSString* nickname;
unsigned age;
} ConnectInfo;
to this method of distributed object
- (oneway void)connect:(in ConnectInfo*)ci
nickname = \[ci->nickname retain]; // or copy - doesn't matter
the NSString is reported leaked by `leaks` tool. There are as many strings leaked as many calls I did. Memory dump shows exactly this string object's contents. Allocation stack trace points inside NSInvocation/_NSWalkData, not into my code.
Distributed object is running in separate Cocoa thread in same process. Both threads has auto-release pool established, and there's no warnings in log regarding autoreleasing. SDK is 10.4u, OS is 10.5.4, my platform is PowerPC.
I tried all combinations of oneway, two-way, in, inout, bycopy, byref, retaining, copying, passing pointer, or reference (ConnectInfo&) to string - every time the string is leaked. If there are more strings in struct, they are also leaked. The only working method is to cast pointer to integer value, but this is a kind of hack.
DO runtime is obviously doing a deep copy of plain C struct, and somehow forgets to release Obj-C objects it copied. Is this a DO bug, or am I doing something wrong?

kasym wrote:
DO runtime is obviously doing a deep copy of plain C struct, and somehow forgets to release Obj-C objects it copied.
No, it isn't. It is doing a bitwise copy. It doesn't "forget" to release the Objective C object. That object is inside a C struct. Nothing happens automatically in C.
Is this a DO bug, or am I doing something wrong?
You are doing something wrong. When working in Cocoa, especially things like Distributed Objects, stick to Cocoa. Use an NSDictionary instead.

Similar Messages

  • Function typeid(object) leaks memory.

    Run the following code and watch the memory usage grows:
    #include <typeinfo.h>
    class CC
    public:
    CC() { }
    int main(int argc, char* argv[])
    CC obj;
    for(;;)
    const char* pp = typeid(obj).name();
    return 0;
    $ CC -V
    CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-05 2002/02/03
    $ uname -a
    SunOS udevaf047 5.8 Generic_108528-09 sun4u sparc SUNW,Ultra-80

    The newest libC patch (released two days ago) is supposed to addres this:
    http://access1.sun.com/patch.public/cgi-bin/readme2html.cgi?patch=108434&type=pub

  • How to avoid the case of leaks memory in Object Oriented Programming

    Hi, Everyone, I am writing a simple web-baed application for JSP and Servlet, I pass all data from JSP to Servlet, It is due to the number of row of record are variable, so I should write a Java Instance class to stored to specific data in a Java Object, and then stored those object in a arraylist In the Servlet class, and then pass the arraylist in to a session, to pass the session from the servlet to another JSP......
    But some thing I am worried about is that if the no of row of record user input is large, then the number of object stored in the arraylist will also large. I am worried it will serious leaks memoary in my server. Because my server always occurs "Out Of Memoary Exception" in Tomcat, So If I use the above method. I affarid the memory will be further leaking in my server. So What can I do? Is it having any better method to prevent memory leaking when using Object Oriented Programming(Except using Hibernate)?
    Can Anyone be help me?
    Thank you very much for All, THX

    Because many people say that the large amount of
    using Object will lead to "memory leak", I am worried
    about the size of object I use is too large and then
    it will construct "memory leak". No it will not! You get a 'memory leak' by holding references to objects you no longer require.
    >
    The detail of my case is that:
    In my web application, there is a session variable
    pass through from one servlet to another jsp/servlet.You should only place small amounts of data in the session. If you need forward from a Servlet to a JSP (or JSP to Servlet) then you should place the data object in the request (using the setAttribute() method), not in the session. In this way, when the session is re-claimed so will be the data object.
    And this session variable is stored a Instance Object
    (which is a class write by me) with the following
    issue:
    1) This instance object having "has-a relationship"
    with another four instance object (all are the
    classes write by me)
    2) This instance object having "has relationship"
    with a arraylist, this arraylist is stored about 4-5
    instance object(all are the classes write by me) .
    If this object having the above issue, Will this
    object construct a "leaks memory" when this object
    stored in the session and pass through servlet to
    another jsp/servlet?
    Message was edited by:
    sabre150

  • Compare system state (number and types of objects in memory)

    We have 2 exactly identical servers running our application talking to the same database.
    When some obejct from server 1 is deleted, a message is passed to server 2 to delete the object from its cache too.
    Forget the database, I want to design a testing system which compares the system-state (number and type of live-objects) in memory for server 1 and server 2 after the operation and the message, and reports any discrepancy.
    Any ideas ?

    Are you trying to debug a distributed cache implementation?
    If you want to inspect the state of your application on multiple servers creating a JMX bean might be a solution.
    http://java.sun.com/developer/technicalArticles/J2SE/jmx.html

  • GetOracleDecimal seems to leak memory?

    Hello, I am using the C# statement below to retrieve a decimal value from an OracleDataReader, adjust the precision, then assign it to a .NET decimal type:
    decimal volume = (decimal)OracleDecimal.SetPrecision(reader.GetOracleDecimal(5), 28);
    Over time, the service that hosts this method leaks memory. After some investigation, I found that "Oracle.DataAccess.Types.OpoDecCtx" types were collecting in the finalize queue. Any ideas on how to resolve this? I can't explicitly Dispose() an OracleDecimal...
    I'm using ODP.NET version 2.102.2.20.
    Thanks

    Thanks for the reply. I am using .NET 2.0 SP2. I upgraded the ODP.NET client to 2.111.7.20 but am still seeing leakage of the OracleDecimal structs.
    Here's a snippet of output from WinDbg:
    Ready for finalization 32874 objects (0b4de540->0b4fe6e8)
    Statistics:
    MT Count TotalSize Class Name
    00fb8cec 32816 656320 Oracle.DataAccess.Types.OpoDecCtx
    With each pass of the service the Count and TotalSize grow in increments equal to the number of rows I'm querying...
    Just for laughs I changed the GetOracleDecimal statement to GetDecimal and the memory issue went away (because I'm no longer creating OracleDecimals). But I need to use the higher precision type to prevent overflows..
    Thanks again..

  • Does ReportDocument leak memory?

    <p class="ssiBODYCOPY">Using CrystalDecisions.CrystalReports.Engine.ReportDocument XI R2.<br /><br />w3wp.exe memory use raises while a report is generated (which is expected), yet it does not seem to be ever released after. If you keep generating same report again and again, IIS eventually runs out of memory.<br />A report does not call any external DLLs or COM objects.<br />Calling repDoc.Dispose() does not seem to help.<br /><br />Please help.<br /></p>

    Methods:
    Dispose()
    GC.WaitForPendingFinalizers()
    GC.Collect()
    Details:
    I created a C# application that connects to BOXI.
    It does not specifically use the ReportDocument object, but was also encountering serious memory issues.
    I was also using the Dipose method to mark objects for garbage collection.
    .Net garbage collection happens automatically (at some time or another), but you can force it using GC.Collect(). I tried this, but was still leaking memory.
    Until I found GC.WaitForPendingFinalizers(), which causes the garbage collector to wait until all disposed objects have completely finished their destructors. I think this made the difference with BOXI objects, because they are nested.
    After I was using all three methods, I had no more memory issues. I realize this information may be out of date, but I posted it for future seekers.

  • Simple JSP leaks memory?

    Simple HelloWorld.jsp leaks memory significantly. Tested with SoapUI setup with 40 clients driving load. At around invocation 100,000 the WLS server simply leaks enough memory to hit the upper heap size and dies. I'm running V10.3.2 (latest) in Production mode with the JRocket JVM. I also tried the same test with HelloWorld.HTML file and found no memory leaks, it runs HTML test fine up to 1,000,000 invocations with no memory or thread leaks.
    This test can not be any simpler.
    Also, performance goes down significantly as memory leaks! I go from 500tps down to 100tps just prior to running out of memory.
    The JSP file is extremely simple, here's the code:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Hello World JSP</title>
    </head>
    <body>
    <p>Hello World!</p>
    </body>
    </html>
    Why would such a simple JSP file cause the WebContainer to leak memory? I'm at a loss here.
    Edited by: user9200447 on Feb 26, 2010 10:47 AM

    It depends on the test being run. One possibility is it may be due to implicit session objects.
    Try using session=false otherwise session objects are created implicitly for this jsp. Dependng on sesson timeout, hits and java heap memory size you can run out of memory
    HTH

  • Applet using JVM 1.5.0_06 causes GDI Object Leaks

    Hi,
    Since the release of 1.5.0_06 our applet has developed a GDI Object leak. Basically, our applet draws on a panel when ever an update is available. The previous versions of the JVM seem fine and th e GDI Objects are stable, but this new version eats the GDIs up really quickly, and never releases them.
    The problem occurs when the applet repaints itself. Calling repaint() or paint() from code works ok with no leaks but as soon as the applet is forced to repaint because of a resize, or because another window has moved over it the GDIs go up by multiples of 10.
    Here is some sample code:
    import java.awt.*;
    import java.applet.*;
    import java.util.Date;
    * <p>Copyright: Copyright (c) 2005</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class GDIApplet extends Applet {
        //Construct the applet
        public GDIApplet() {
        //Initialize the applet
        public void init() {
            try {
                jbInit();
            } catch (Exception e) {
                e.printStackTrace();
        //Component initialization
         private void jbInit() throws Exception {
             this.setLayout(new BorderLayout());
             this.add(new GDIPanel(), BorderLayout.CENTER);
         public class GDIPanel extends Panel implements Runnable{
        public GDIPanel() {
            Thread t = new Thread(this,"SPGPaintTimer");
            t.start();
        public void paint(Graphics g){
            if( g == null){
                return;
            System.out.println("Paint on thread: " + Thread.currentThread().getName());
            Date d = new Date();
            Rectangle bounds = getBounds();
            g.setColor(Color.black);
            g.fillRect(0,0, bounds.width, bounds.height);
            FontMetrics fm = g.getFontMetrics();
            String val = d.toString();
            int width = fm.stringWidth(val);
            int height = fm.getHeight();
            int x = (bounds.width - width) /2;
            int y = (bounds.height/2) - height;
            g.setColor(Color.yellow);
            g.drawString(val,x,y);
        public void run(){
            while(true){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException ex) {
                repaint();
    }

    Hi there.
    I've found this page by googling.
    I am not a Java developer, but am using a third party java applet on my web page for mapping.
    Funnily enough, I've been trying to hunt down a memory leak thats occuring in IE (not any other browser).
    It only occurs when the applet is physically visible on the page, and the user is using the Sun JVM (1.5.0_06). The GDI object count increases every time I mouseover a link in a tree.
    This does not occur with the MS JVM.
    Unfortunately I do not have access to the applet source code, but I'm wondering if its related to your problem.
    Have you had any success on this?
    Thanks.

  • Imapd service "Leak  Memory"

    I already have Java Communications Suite 6 Working , but, I have a Leak Memory problems with imapd process.
    I have the server with 30 imapd process, 30 mshttpd process, and 30 pop process running to balance the load of the users.
    All work fine(the CPU is 100% idle, the RAM is 80% available=6GB) when I access via browser(Chrome,Firefox), too when I access it with the traditional clients IMAP (Outlook, ThunderBird,etc).
    The problem is that if one user want to copy(not just view) locally all your emails to your laptops/pc, the imapd process eat more than 3GB(instead of 80MB) of RAM and the system is getting slower.
    If the user cancel this process(copy via IMAP all your emails) the process dont freedom doesn't release the memory and the system getting slower.
    Actually my solution is:
    # kill -9 <PID_imapd>
    Some times when I kill the process the problem going to other imapd process, so in this case the solution is:
    /opt/sun/comms/messaging/sbin/stop-msg
    /opt/sun/comms/messaging/sbin/start-msg
    I think that this problem is a bug but I dont know what is the patch.
    May you help me? Any idea?
    My system is:
    A X2100 with one socket AMD Opteron 2600Mhz, 8GB RAM, 2 x disks 750GB in mirror with Solaris Volume Manager, Soalris 10 HW 10/08.
    Thanks.
    Jaime

    Jorth, maybe we are not well explained,
    the normal operation of imapd process(one process) need no more that 200MB, when a user is linked to it.
    Check my example:
    ================================================================================================================
    PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
    874 root 610M 421M sleep 59 0 0:14:51 0.1% java/160
    818 webservd 413M 285M sleep 59 0 0:16:43 0.3% webservd/95
    607 root 326M 45M sleep 59 0 0:07:01 0.1% webservd/58
    16719 mailsrv 283M 50M sleep 59 0 0:00:06 0.0% imapd/5
    798 root 237M 37M sleep 59 0 0:04:04 0.1% ns-slapd/48
    *16673 mailsrv 220M 97M sleep 59 0 0:00:06 0.0% imapd/6*
    *16677 mailsrv 210M 42M sleep 59 0 0:00:05 0.0% imapd/5*
    *16696 mailsrv 205M 36M sleep 59 0 0:00:04 0.0% imapd/5*
    *16695 mailsrv 200M 38M sleep 59 0 0:00:04 0.0% imapd/6*
    *16685 mailsrv 197M 38M sleep 59 0 0:00:08 0.0% imapd/5*
    *16682 mailsrv 195M 40M sleep 59 0 0:00:04 0.0% imapd/5*
    *16681 mailsrv 193M 46M sleep 59 0 0:00:04 0.0% imapd/5*
    *16690 mailsrv 187M 52M sleep 59 0 0:00:03 0.1% imapd/6*
    *16687 mailsrv 187M 40M sleep 59 0 0:00:05 0.0% imapd/5*
    *902 icsuser 185M 24M sleep 59 0 0:00:05 0.0% cshttpd/2*
    NPROC USERNAME SWAP RSS MEMORY TIME CPU
    78 mailsrv 2439M 2329M 28% 0:11:53 0.5%
    14 icsuser 1064M 233M 2.8% 0:06:55 0.0%
    136 root 965M 727M 8.9% 2:15:20 50%
    1 webservd 264M 326M 4.0% 0:16:43 0.3%
    1 noaccess 90M 100M 1.2% 0:01:13 0.0%
    Total: 237 processes, 1042 lwps, load averages: 1.91, 1.90, 1.89
    ================================================================================================================
    When we run an aplication like OutLook to copy locally to the laptopn all the mail via IMAP, "ONE imapd process" eat more memory that need it and never released.
    Example:
    ================================================================================================================
    PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
    *16673 mailsrv 2856M 2534M sleep 59 0 0:00:06 45% imapd/6* <---------------this process eat memory and slow the system(CPU/RAM)
    874 root 610M 421M sleep 59 0 0:14:51 0.1% java/160
    818 webservd 413M 285M sleep 59 0 0:16:43 0.3% webservd/95
    607 root 326M 45M sleep 59 0 0:07:01 0.1% webservd/58
    16719 mailsrv 283M 50M sleep 59 0 0:00:06 0.0% imapd/5
    798 root 237M 37M sleep 59 0 0:04:04 0.1% ns-slapd/48
    *16677 mailsrv 210M 42M sleep 59 0 0:00:05 0.0% imapd/5*
    *16696 mailsrv 205M 36M sleep 59 0 0:00:04 0.0% imapd/5*
    *16695 mailsrv 200M 38M sleep 59 0 0:00:04 0.0% imapd/6*
    *16685 mailsrv 197M 38M sleep 59 0 0:00:08 0.0% imapd/5*
    *16682 mailsrv 195M 40M sleep 59 0 0:00:04 0.0% imapd/5*
    *16681 mailsrv 193M 46M sleep 59 0 0:00:04 0.0% imapd/5*
    *16690 mailsrv 187M 52M sleep 59 0 0:00:03 0.1% imapd/6*
    *16687 mailsrv 187M 40M sleep 59 0 0:00:05 0.0% imapd/5*
    *902 icsuser 185M 24M sleep 59 0 0:00:05 0.0% cshttpd/2*
    NPROC USERNAME SWAP RSS MEMORY TIME CPU
    78 mailsrv 2439M 2329M 80% 0:00:5 0.5%
    78 mailsrv 2439M 2329M 10% 0:11:53 0.5%
    14 icsuser 1064M 233M 2.8% 0:06:55 0.0%
    136 root 965M 727M 8.9% 2:15:20 50%
    1 webservd 264M 326M 4.0% 0:16:43 0.3%
    Total: 237 processes, 1042 lwps, load averages: 1.91, 1.90, 1.89
    ===================================================================================================
    The rest of the imapd process(29) in this moment just load 40-50MB(when those are free).
    If we kill the process 16673 the user connect to the next imapd process and the problem persist whit the same patology: eat memory and CPU, and slow the system.
    So, we think that is not normal and maybe we need patch the system to solve the problem.
    We will to test the 64Bit version in this moment and we will post the results.
    Thank
    Jaime

  • In Keynote '09 distribute objects horizontally/vertically is distributing objects beyond the slide. How do I make the left-most and right-most objects the limit of the distribution?

    I used to have the option of distributing objects so that they would overlap, but the current "distribute" tool is functioning as if overlapping isn't allowed. The result is that the objects move beyond the limits of the slide. Any suggestions?

    I know that's what *should* happen, but it just doesn't. I've made screen-grabs of the entire process:
    Like I said, this use to work just as you've described it. Is there a box I accidentally selected? I just really don't understand why the tool has changed the way it functions...

  • Reading Lots of Objects into Memory

    I need to read thousands of fairly large objects from an object database to the point that the JMV memory runs out.
    A solution is to: read, use and discard as opposed to loading all the objects into memory at once -pretty simple but I want to do it right. I have a general idea on how to implement the approach but I need your help in locating some reading materials, code snipplets and/or best practices.
    Thanks!

    If you're using thousands of objects you might look into the Flyweight Pattern (depending on what these objects are and what state they have). You might also look into increasing the amount of memory available to the JVM via that -Xms switch.
    Aside from that, if you reuse the same reference name (variable name)(s) you'll allow the Garbage Collector to recover that memory.
    Good Luck
    Lee

  • How to remove the Object from memory.

    Hello.
    Flash file that i made with Flex Builder uses memory too
    much.
    Look at the next example source code.
    var testCan:Canvas = new Canvas();
    this.addChild(testCan);
    this.removeChild(testCan);
    testCan = null;
    but just memory usage still goes up, is not freed instantly.
    so if i load the large flash files on my web browser,
    after 5 munites or something, the web browser is down.
    How to remove the object from memory immediately without
    delay?

    It's all about the Garbage Collector ..
    There is a nice write up here :
    http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html

  • Leak memory in xerces DomParser

    Hey,
    I have " leak memory " in my Java application (Stand alone).
    I suspect that this leak caused by xerces DomParser.
    i reached to this conculsion after using in Jprobe as a memory debuger.
    Does any one has a similar problem?
    Thank you.
    code:
    DOMParser parser = new DOMParser();
    parser.parse(new InputSource(new FileInputStream(schemaFile)));

    Hey, which Version of Xerces do you use?

  • Why does Firefox 4 (4.0.1 specifically) leak memory?

    '''Answer:''' I figured it out.
    History lesson first. Ever since the 4.0.1 update, Firefox 4 has been crashing A LOT. It's gotten so bad that FF4.0.1 will eat memory with no end in sight and eventually Windows (Win 7 64-bit) forcefully close the program due to an out of memory error.
    I have 8 GB of RAM installed. And, it would crash once it exceeds 1.5 GB of RAM used by Firefox 4. I've seen Firefox 4 go up to 1.85 GB of RAM in Task Manager. This is with 20 tabs open.
    With the add-on Leak-Monitor, I've narrowed down the issue. Having only Leak-Monitor as the extension installed, all pop-ups point to how '''poorly Firefox 4 handles Javascript'''!
    MSNBC Leak Monitor issue:
    [http://www.octoberasian.com/tech/text/FF4-Leak-Monitor_MSNBC.txt Leak Monitor log from MSNBC.com]
    I've gotten more pop-ups from even support.mozilla.com because of the Javascript on this website.
    Firefox 4.0.1 is leaking memory from every Javascript on every website I load. It's leaking memory as we speak with only this page loaded (one tab).
    FIX IT! Firefox 4 is poorly handling Javascript, especially when multiple tabs are opened.

    octoberasian: I, too, am experiencing this phenomenon. I shut my system down, pulled the EIC cable, held down the power button - then replugged and rebooted. I closed down every unneeded application that I have set to auto-start. Finally, I opened a single Firefox 4.0.1 window and let it sit. It began with consuming 43 Mb of memory. By afternoon - about 5 hours later - it was up to 203 Mb. There is definitely something very wrong with this version. It does the same on all the machines we have, sans our server. We don't use the server for anything but being a server & it has some version of Firefox 3 on it anyway. No Java Scripts were running, nor were any Adobe ARM or any plugins. I noticed when plugins run - the memory leakage goes into overdrive. Hey, I'm just sayin'...

  • Skype 6.4 continues to leak memory at an astonishing rate? Hard crashes ALL my Macs

    Last version of Skype 6.3 leaked memory like a river full of rapids. And once it gobbled up 1.5gigs or so of memory, it HARD crashed my iMac requiring a hard reboot. It only takes about 30 minutes for skype to do this. My iMac (2012 Core i7 3.4ghz 32 gigs RAM) is at Mac OSX 10.7.5 and it is repeatable every time. I have to set timers to remind me to restart Skype every 30 minutes.
    We thought 6.4 would fix the issue but no luck doing exact same thing. My colleague is across the country on an iMac with 10.7.5 same issues. Repeatable on my Macbook Pro running 10.8. If he let's it run, he gets the black screen of death and have to hard restart. Just like me.
    This issue has been around for several weeks and is making skype unusuable for us and we rely on it heavily. Note we are PAYING customers. to Skype.
    This ONLY happens if we use the video feature. Submitted to Skype, wondering if anyone else having issue?

    Last version of Skype 6.3 leaked memory like a river full of rapids. And once it gobbled up 1.5gigs or so of memory, it HARD crashed my iMac requiring a hard reboot. It only takes about 30 minutes for skype to do this. My iMac (2012 Core i7 3.4ghz 32 gigs RAM) is at Mac OSX 10.7.5 and it is repeatable every time. I have to set timers to remind me to restart Skype every 30 minutes.
    We thought 6.4 would fix the issue but no luck doing exact same thing. My colleague is across the country on an iMac with 10.7.5 same issues. Repeatable on my Macbook Pro running 10.8. If he let's it run, he gets the black screen of death and have to hard restart. Just like me.
    This issue has been around for several weeks and is making skype unusuable for us and we rely on it heavily. Note we are PAYING customers. to Skype.
    This ONLY happens if we use the video feature. Submitted to Skype, wondering if anyone else having issue?

Maybe you are looking for

  • Creative Cloud desktop app won't login

    Creative Cloud desktop app won't login any more keeps saying "Unknown Server Error -  Sign in is currently unavailable. We are unable to access your account Please try again later.." it's been like this for a week..  alll the other apps are signed in

  • Audit Log Trimming Timer Job stuck at "pausing" status

    Hi, We have a SharePoint 2010 farm and our Audit table is growing rapidly. I checked our "Audit log Trimming" timer job and it has been stuck at "pausing" status for more than a month. Any advice to resolve this issue would be great. Thanks, norasamp

  • Compositing Motion output files

    Hi all- I asked a question and many chimed in, but the answers didn't quite rectify the issue. I re-read my post, and I think the issue could have been better explained. Here goes: We are producing an animated trailer for our film. In Motion, we crea

  • Obtain client IP address from forms

    Hello, In a form i'm programming, i need to obtain the ip address from which the client which is executing. If i used Oracle 8i, i would get is using sys_context function, but i use: forms 5 on Oracle Server 8.0.5 I need urgent help with this stuff,

  • Commitment item can not derived from main asset number

    Dear all, Our client have 1 G/L LVA and divided to many asset class LVA. Asset lva will post to general expense when run depreciation, and they want the acquisition/procurement of LVA should check the budget of the general expense. It means the acqui