[mico-devel] Corba Any memory leak?

Mark Richardson markmapo at yahoo.com
Thu Feb 15 17:20:12 PST 2007


Since everyone has been so helpful in the past, I was hoping that you could help me with this one.  I'm having memory problems with mico, and I'm not sure if its a corba any issue.  
   
  my IDL...
  module MyModule
  {
    struct MyStruct
    {
      short index;
      any value;
      int status;
    };
    typedef sequence<MyStruct> MyStructSequence;
   
    interface MyClient
    {
      oneway void updateOne(in MyStruct myStructIn);
      oneway void updateAll(in  MyStructSequence myStructSequenceIn);
    }
   
    interface MyServer
    {
      boolean linkClient(in MyClient myClientIn);
    }
  }
   
  My server binds itself to the imr, then the client connects to the server, and calls linkClient().  Then, the server repeatedly calls updateAll() with the new data.  The server calls updateAll in the client over 100 times in a second.  After about 30 seconds, the memory footprint of the client goes up about 128k.  Both of these are multi-threaded, and it makes it somewhat difficult to debug, so I can't tell exactly where the memory issue is - but I know that it's from the corba calls.
   
  One thing that I'm not sure about, is the stub that is created for MyClient, shows
  void MyModule::MyClient_stub::updateAll (const MyModule::MyStructSequence& _par_myStructSequenceIn)
  I don't think I need to "take ownership" of _par_myStructSequenceIn by calling in().  But if the client has a variable
  MyModule::MyStructSequence clientStructSequence;
  clientStructSequence.length(100);
   
  Then, while inside of updateAll, I perform
  clientStructSequence[_par_myStructSequenceIn[0].index]=_par_myStructSequenceIn[0];
   
  Have I messed up the memory allocation and lost the pointer(s) to clientStructSequence[0].value? Or have I duplicated _par_myStructSequenceIn[0] so that it will never be deallocated?
   
  Thanks in advance for any help,
  Mark
   

 
---------------------------------
Everyone is raving about the all-new Yahoo! Mail beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mico.org/pipermail/mico-devel/attachments/20070215/8e15918a/attachment.html


More information about the Mico-devel mailing list