Disposing strings created from a resource file using resource mana

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 
Back
Top