Discussion:
[omniORB] create_reference_with_id
Jun
2006-07-27 02:03:07 UTC
Permalink
I'm relatively new in CORBA and working to implement a ServantLocator.
One question I have is what does POA.create_reference_with_id exactly do?
Since I'm using a ServantLocator, it should just generate object reference
and shouldn't cache the newly generated reference?
I'm asking this because I'm seeing a memory leak in my test server.
As a test I have put a loop in ServantLocator.preinvoke() to call
create_reference_with_id repeatedly and this seems to increase the memory
usage.

Please let me know if you need any more details or suggestions.

thanks,
Jun Lee
JiangWei
2006-07-27 06:32:35 UTC
Permalink
Post by Jun
I'm relatively new in CORBA and working to implement a ServantLocator.
One question I have is what does POA.create_reference_with_id exactly do?
Since I'm using a ServantLocator, it should just generate object reference
and shouldn't cache the newly generated reference?
I'm asking this because I'm seeing a memory leak in my test server.
As a test I have put a loop in ServantLocator.preinvoke() to call
create_reference_with_id repeatedly and this seems to increase the memory
usage.
using _var to manage memory like this:
CORBA::Object_var ref = poa->create_reference_with_id(id);
Post by Jun
Please let me know if you need any more details or suggestions.
thanks,
Jun Lee
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
JiangWei
2006-07-27 07:01:57 UTC
Permalink
Post by JiangWei
Post by Jun
I'm relatively new in CORBA and working to implement a ServantLocator.
One question I have is what does POA.create_reference_with_id exactly do?
Since I'm using a ServantLocator, it should just generate object reference
and shouldn't cache the newly generated reference?
I'm asking this because I'm seeing a memory leak in my test server.
As a test I have put a loop in ServantLocator.preinvoke() to call
create_reference_with_id repeatedly and this seems to increase the memory
usage.
CORBA::Object_var ref = poa->create_reference_with_id(id);
using _unchecked_narrow to avoid activate object
Post by JiangWei
Post by Jun
Please let me know if you need any more details or suggestions.
thanks,
Jun Lee
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
Duncan Grisby
2006-07-27 22:08:56 UTC
Permalink
Post by Jun
I'm relatively new in CORBA and working to implement a ServantLocator.
Have you read Michi Henning and Steve Vinoski's book, "Advanced CORBA
Programming with C++"? At least the sections about ServantLocators? If
not, I strongly recommend that you do so.
Post by Jun
One question I have is what does POA.create_reference_with_id exactly do?
It creates an object reference in the POA with the given id. That is all
it does.
Post by Jun
Since I'm using a ServantLocator, it should just generate object reference
and shouldn't cache the newly generated reference?
It generates an object reference and returns it. It is your
responsibility to release the reference it gives you.
Post by Jun
I'm asking this because I'm seeing a memory leak in my test server.
As a test I have put a loop in ServantLocator.preinvoke() to call
create_reference_with_id repeatedly and this seems to increase the memory
usage.
Do you release the object references given to you with
create_reference_with_id? If not, that's the cause of your leak. As an
aside, why are you calling create_reference_with_id inside preinvoke?
That's an unusual thing to do there.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...