PC Review


Reply
Thread Tools Rate Thread

Disposing strings created from a resource file using resource mana

 
 
=?Utf-8?B?TXVydGh5?=
Guest
Posts: n/a
 
      24th Jun 2007
HI,
we have developed Multi Lingual Windows mobile 5.0 application.

In this i am loading the Form text from a resource manager.

Label1.Text = ResManager.GetString("Label_Text");
button1.Text = ResManager.GetString("button");

But when i veiw the application in Remote Performace monitor, these strings
are not getting disposed when i dispose my form. This is creating a lot of
Memory leakage.

How can i dispose the string created from the Resouce file using this
Resouce Manager.

Thanks in advance,
Murthy
 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      24th Jun 2007
Strings don't implement IDisposable, so they can't be "disposed". Are you
saying that they're not getting freed when the Form is Disposed? If so,
that's not unexpected. Calling Dispose doesn't free anything, it simply
calls the Dispose method and removes a root. Actual cleanup of objects
wouldn't occur until the next GC. Have you checked to see if a GC following
the call to the containing Form's Dispose is releasing the objects? How
about if you just send the app to the background? Are you actually
experiencing memory issues, or are you just seeing this behavior in RPM?

We're using resources heavily in a project to load probably hundreds of
thousands or even millions of strings in long-term testing and haven't seen
any problems associated with anything pulled from a string resource
assembly.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com


"Murthy" <(E-Mail Removed)> wrote in message
news:781E7EDC-F746-4FA6-A73D-(E-Mail Removed)...
> HI,
> we have developed Multi Lingual Windows mobile 5.0 application.
>
> In this i am loading the Form text from a resource manager.
>
> Label1.Text = ResManager.GetString("Label_Text");
> button1.Text = ResManager.GetString("button");
>
> But when i veiw the application in Remote Performace monitor, these
> strings
> are not getting disposed when i dispose my form. This is creating a lot of
> Memory leakage.
>
> How can i dispose the string created from the Resouce file using this
> Resouce Manager.
>
> Thanks in advance,
> Murthy



 
Reply With Quote
 
=?Utf-8?B?TXVydGh5?=
Guest
Posts: n/a
 
      25th Jun 2007
I have compared GC Head using Remote Performance Monitor....
the System.String and System.Byte class objects are taking maximum memory
and the count of these objects is not getting decreased even if i make a
string null.

Can some one tell me why this is happening.

Thanks,
Murthy

"<ctacke/>" wrote:

> Strings don't implement IDisposable, so they can't be "disposed". Are you
> saying that they're not getting freed when the Form is Disposed? If so,
> that's not unexpected. Calling Dispose doesn't free anything, it simply
> calls the Dispose method and removes a root. Actual cleanup of objects
> wouldn't occur until the next GC. Have you checked to see if a GC following
> the call to the containing Form's Dispose is releasing the objects? How
> about if you just send the app to the background? Are you actually
> experiencing memory issues, or are you just seeing this behavior in RPM?
>
> We're using resources heavily in a project to load probably hundreds of
> thousands or even millions of strings in long-term testing and haven't seen
> any problems associated with anything pulled from a string resource
> assembly.
>
>
> --
>
> Chris Tacke, Embedded MVP
> OpenNETCF Consulting
> Managed Code in an Embedded World
> www.OpenNETCF.com
>
>
> "Murthy" <(E-Mail Removed)> wrote in message
> news:781E7EDC-F746-4FA6-A73D-(E-Mail Removed)...
> > HI,
> > we have developed Multi Lingual Windows mobile 5.0 application.
> >
> > In this i am loading the Form text from a resource manager.
> >
> > Label1.Text = ResManager.GetString("Label_Text");
> > button1.Text = ResManager.GetString("button");
> >
> > But when i veiw the application in Remote Performace monitor, these
> > strings
> > are not getting disposed when i dispose my form. This is creating a lot of
> > Memory leakage.
> >
> > How can i dispose the string created from the Resouce file using this
> > Resouce Manager.
> >
> > Thanks in advance,
> > Murthy

>
>
>

 
Reply With Quote
 
Guest
Posts: n/a
 
      25th Jun 2007
I don't think you fully understand how the GC work (and you've still not
said if this is actually causing a problem). You might take a look at this
to see if it clears things up:

https://msevents.microsoft.com/CUI/E...&culture=en-US


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com


"Murthy" <(E-Mail Removed)> wrote in message
news:1304258A-4DBC-487D-B057-(E-Mail Removed)...
>I have compared GC Head using Remote Performance Monitor....
> the System.String and System.Byte class objects are taking maximum memory
> and the count of these objects is not getting decreased even if i make a
> string null.
>
> Can some one tell me why this is happening.
>
> Thanks,
> Murthy
>
> "<ctacke/>" wrote:
>
>> Strings don't implement IDisposable, so they can't be "disposed". Are
>> you
>> saying that they're not getting freed when the Form is Disposed? If so,
>> that's not unexpected. Calling Dispose doesn't free anything, it simply
>> calls the Dispose method and removes a root. Actual cleanup of objects
>> wouldn't occur until the next GC. Have you checked to see if a GC
>> following
>> the call to the containing Form's Dispose is releasing the objects? How
>> about if you just send the app to the background? Are you actually
>> experiencing memory issues, or are you just seeing this behavior in RPM?
>>
>> We're using resources heavily in a project to load probably hundreds of
>> thousands or even millions of strings in long-term testing and haven't
>> seen
>> any problems associated with anything pulled from a string resource
>> assembly.
>>
>>
>> --
>>
>> Chris Tacke, Embedded MVP
>> OpenNETCF Consulting
>> Managed Code in an Embedded World
>> www.OpenNETCF.com
>>
>>
>> "Murthy" <(E-Mail Removed)> wrote in message
>> news:781E7EDC-F746-4FA6-A73D-(E-Mail Removed)...
>> > HI,
>> > we have developed Multi Lingual Windows mobile 5.0 application.
>> >
>> > In this i am loading the Form text from a resource manager.
>> >
>> > Label1.Text = ResManager.GetString("Label_Text");
>> > button1.Text = ResManager.GetString("button");
>> >
>> > But when i veiw the application in Remote Performace monitor, these
>> > strings
>> > are not getting disposed when i dispose my form. This is creating a lot
>> > of
>> > Memory leakage.
>> >
>> > How can i dispose the string created from the Resouce file using this
>> > Resouce Manager.
>> >
>> > Thanks in advance,
>> > Murthy

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to load resource from resource file. Plese check up your setup Andry Microsoft Dot NET Framework 0 22nd Nov 2005 07:52 AM
Can i save a list of strings in a resource file? Julia Microsoft C# .NET 1 3rd Jun 2005 04:05 PM
Custom strings getting erased from resource file =?Utf-8?B?Um9iZXJ0IFcu?= Microsoft C# .NET 0 7th May 2005 05:11 AM
Brush Resource - Disposing =?Utf-8?B?RGVubmlz?= Microsoft VB .NET 5 23rd Dec 2004 04:11 PM
can I call getString() to get a string from a separate resource file instead of embedded resource? babylon Microsoft Dot NET Framework 2 7th Oct 2003 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:57 PM.