[jacorb-developer] Removing a servant from JacORB after calling "servant_to_reference"

Andrew Bourgeois code.3.tin at gmail.com
Wed Feb 15 10:16:13 CET 2012


Hi Phil,
Hi Nick,

@Phil: It looks like your solution does the trick. It'll need more testing,
but a quick test shows (in JProfiler) that the objects are gone. Other
objects that have the same problem are still there, so the app didn't
break. Thanks a lot.

@Nick: It's the server that generates servant objects and generates an IOR
so that the client can use it to connect to the server. I can't test the
new version 3 (beta) at work, but I will at home later this week.

Best regards

Andrew

2012/2/14 Nick Cross <jacorb at goots.org>

> Hi Andrew,
>
> As Phil mentioned there are different alternatives for server side.
> Perhaps you could clarify whether you are seeing the problem on the client
> or server? Could you try with the current beta please as well?
>
> Thanks
>
> Nick
>
>
> On 14/02/12 15:30, Andrew Bourgeois wrote:
>
>> Hi Nick
>>
>> using _release() on "ref" or "href" didn't remove the objects from the
>> Hashtable.
>> Before you have to ask: the MyObj instances remain local variables, I'm
>> not holding any references to them somewhere else, only JacORB does.
>> Creating a main with just the CORBA part is going to take a while, I
>> really do hope you can help me without.
>>
>> I'm using JacORB 2.3.1 (with the SLF4J binding changed to LOG4J, but
>> that shouldn't change the way it behaves).
>>
>> Best regards
>>
>> Andrew
>>
>> 2012/2/14 Nick Cross <jacorb at goots.org <mailto:jacorb at goots.org>>
>>
>>
>>
>>    You could call ref._release().
>>
>>    Can you provide a reproducible test case for the OutOfMemory?
>>
>>    Also, what version of JacORB are you using?
>>
>>
>>    Regards
>>
>>    Nick
>>
>>
>>    On 14/02/12 14:18, Andrew Bourgeois wrote:
>>
>>        Hello
>>
>>        the following sequence gives me an IOR and keeps the MyObj instance
>>        somewhere inside JacORB so that the IOR can be used at a later
>>        stage:
>>
>>        MyObj myObj = new MyObj();
>>        org.omg.CORBA.Object ref = poa.servant_to_reference(__**myObj);
>>
>>        org.omg.CORBA.Object href = MyObjHelper.narrow(ref);
>>        String ior = orb.object_to_string(href);
>>
>>        My question:
>>        Can I somehow tell JacORB to discard "myObj"? References are
>>        kept forever
>>        in some Hastable (inside JacORB), and when creating a lot of
>>        entries, a
>>        wild OutOfMemory appears at some point. I want JacORB to forget
>>        about my
>>        object when I tell him to.
>>
>>        Thank you for your help!
>>
>>        Best regards
>>
>>        Andrew
>>        ______________________________**___________________
>>        jacorb-developer maillist  -
>>        jacorb-developer at lists.spline.**__inf.fu-berlin.de
>>        <mailto:jacorb-developer@**lists.spline.inf.fu-berlin.de<jacorb-developer at lists.spline.inf.fu-berlin.de>
>> >
>>        https://lists.spline.inf.fu-__**berlin.de/mailman/listinfo/__**
>> jacorb-developer<https://lists.spline.inf.fu-__berlin.de/mailman/listinfo/__jacorb-developer>
>>        <https://lists.spline.inf.fu-**berlin.de/mailman/listinfo/**
>> jacorb-developer<https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer>
>> >
>>
>>
>>
>>
>


More information about the jacorb-developer mailing list