[Mono-list] Two questions about System.Windows.Controls.Image

Spencer, Matthew MSpencer at ndsuk.com
Wed Aug 22 10:07:48 EDT 2007


Hi Paolo

Attached is the example app, I run out of memory pretty quick using
this.

Matt

-----Original Message-----
From: mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Paolo Molaro
Sent: 22 August 2007 14:31
To: mono-list at lists.ximian.com
Subject: Re: [Mono-list] Two questions about
System.Windows.Controls.Image

On 08/17/07 Spencer, Matthew wrote:
>  Either I am using it incorrectly, or there is a severe memory leak in

> its implementation.  The way I am using it is to create two Image 
> objects, and fade between the two of them, repeatedly loading the next

> image by calling SetSource(..) on the hidden object.  It appears that 
> the memory of previous images is never released.  Is this what is 
> expected, or is there a problem with the current implementation?

Please post a complete sample that can be used to reproduce the issue so
we can debug it.

> My next question is about garbage collection when the bulk of the 
> storage for an object is in native space (as I think it is with the 
> Image class).  I know I have done this before with Java and the 
> garbage collector never kicked in because the runtime was only aware 
> of a small amount of data being consumed by unreferenced objects (a 
> reference to the native data store).  I'm not sure if Mono uses a 
> similar policy on deciding if garbage collection is necessary, but 
> this may cause a problem for Silverlight apps in the future if it
does.

Version 2.0+ of the runtime supports the
GC.AddMemoryPressure()/RemoveMemoryPressure() for this purpouse: call
the first when allocating the unamanged data and the second when
releasing it. We currently do nothing with this, but it's good to have
the stuff in place for when the GC will make its decisions based also on
this.

lupus

--
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better
_______________________________________________
Mono-list maillist  -  Mono-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list
Disclaimer:
************************************************************************
*********************************
This e-mail is confidential, the property of NDS Ltd and intended for
the addressee only.  Any dissemination, copying or distribution of this
message or any attachments by anyone other than the intended recipient
is strictly prohibited.  If you have received this message in error,
please immediately notify the postmaster at nds.com and destroy the
original message.  Messages sent to and from NDS may be monitored.  NDS
cannot guarantee any message delivery method is secure or error-free.
Information could be intercepted, corrupted, lost, destroyed, arrive
late or incomplete, or contain viruses.  We do not accept responsibility
for any errors or omissions in this message and/or attachment that arise
as a result of transmission.  You should carry out your own virus checks
before opening any attachment.  Any views or opinions presented are
solely those of the author and do not necessarily represent those of
NDS.

To protect the environment please do not print this e-mail unless
necessary.

NDS Limited Registered office: One Heathrow Boulevard, 286 Bath Road,
West Drayton, Middlesex, UB7 0DQ, United Kingdom. A company registered
in England and Wales  Registered no. 3080780   VAT no. GB 603 8808 40-00
************************************************************************
**********************************

*********************************************************************************************************
This e-mail is confidential, the property of NDS Ltd and intended for the addressee only.  Any dissemination, copying or distribution of this message or any attachments by anyone other than the intended recipient is strictly prohibited.  If you have received this message in error, please immediately notify the postmaster at nds.com and destroy the original message.  Messages sent to and from NDS may be monitored.  NDS cannot guarantee any message delivery method is secure or error-free.  Information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.  We do not accept responsibility for any errors or omissions in this message and/or attachment that arise as a result of transmission.  You should carry out your own virus checks before opening any attachment.  Any views or opinions presented are solely those of the author and do not necessarily represent those of NDS.

To protect the environment please do not print this e-mail unless necessary.

NDS Limited Registered office: One Heathrow Boulevard, 286 Bath Road, West Drayton, Middlesex, UB7 0DQ, United Kingdom. A company registered in England and Wales  Registered no. 3080780   VAT no. GB 603 8808 40-00
**********************************************************************************************************

-------------- next part --------------
A non-text attachment was scrubbed...
Name: flickr.cs
Type: application/octet-stream
Size: 5879 bytes
Desc: flickr.cs
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20070822/c45b2ac9/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: picture.xaml
Type: application/octet-stream
Size: 1589 bytes
Desc: picture.xaml
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20070822/c45b2ac9/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: default.xaml
Type: application/octet-stream
Size: 547 bytes
Desc: default.xaml
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20070822/c45b2ac9/attachment-0002.obj 


More information about the Mono-list mailing list