|
From: Dave H. <hel...@li...> - 2014-11-24 23:38:52
|
Hi Abhirup,
Before delving into this deeper: are you seeing some memory leak in your
provider, or in the broker? While I agree the code there could use a
little cleanup... an instance object created by the broker: i.e.
through a call to CMNewInstance() or broker->eft->newInstance(), is
created as tracked-memory (see modules object.c and support.c) so it
does not need to be explicitly freed. It's true that adding a release()
there causes no issue, but I didn't see any memory accumulation w/o it,
and I think that's because tracked memory is handling it.
Are you seeing any difference with a free there?
Thanks,
Dave
On 11/18/2014 01:20 AM, ABH...@De... wrote:
>
> *Dell Customer Communication*
>
> Hi,
>
> We were analyzing memory leaks in our provider context when I hit upon
> the following function, I believe it is called through CMReturnInstance.
>
> static CMPIStatus __rft_returnInstance(const CMPIResult * result,
> const CMPIInstance * instance) //line number 237, result.c
>
> In this function,
>
> int size,isInst=isInstance(instance);
>
> NativeResult *r = (NativeResult*) result;
>
> int releaseInstance=0;
>
> ...
>
> if (r->qs) {
>
> ...
>
> if (r->qs->where) {
>
> ...
>
> instance= r->qs->ft->cloneAndFilter(r->qs,(CMPIInstance
> *)instance,r->qs->cop,r->qs->keys);
>
> releaseInstance=1;
>
> ...
>
> instance= r->qs->ft->cloneAndFilter(r->qs,(CMPIInstance
> *)instance,r->qs->cop,r->qs->keys);
>
> releaseInstance=1;
>
> ...
>
> if (r->legacy) {
>
> ...
>
> if(isInst) {
>
> v.inst = CMClone(instance,NULL);
>
> memLinkInstance(v.inst);
>
> *[Abhirup] I guess we need to put releaseInstance = 1 here?***
>
> }
>
> else v.inst = (CMPIInstance *) instance;
>
> rc=returnData(result, &v, CMPI_instance);
>
> if (releaseInstance) instance->ft->release((CMPIInstance*)instance);
> *[Abhirup] If we don't make releaseInstance=1 as shown in the last
> comment and if r->qs is False, then this is a Dead Code (might be
> leading to memory leak as well??)*
>
> _SFCB_RETURN(rc);
>
> ...
>
> if (releaseInstance) instance->ft->release((CMPIInstance*)instance);
>
> _SFCB_RETURN(st);
>
> Kindly share your thoughts on this.
>
> Regards,
>
> Abhirup Seal
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>
>
> _______________________________________________
> Sblim-devel mailing list
> Sbl...@li...
> https://lists.sourceforge.net/lists/listinfo/sblim-devel
|