DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 23 Aug 2007 15:02:42 +0900,    posted on: microsoft.public.dotnet.framework.drawing        back       

Thread Index
  1    Norman Diamond am


OutOfMemory is intermittent, maybe here's why   
After a call to Graphics.DrawImage, an OutOfMemory error might occur.  The 
probability of an error has some correlation with the size of the image but 
is not reliable.  Even with an image of a few hundred megabytes, sometimes 
the error occurs and sometimes not.  Some random postings on the web and 
newsgroups say the image file is broken, well, the image file doesn't 
alternate between being broken and not.  The error is intermittent.

When running under a debugger, sometimes Visual Studio asserts that the 
error occured in some other random place such as Application.Run.  But not 
always.  So I think sometimes the stack is getting smashed.

Now get this.  Inserting some calls to GC.Collect *increases* the 
probability of an OutOfMemory error.  Deleting those calls *decreases* the 
probability.  This seems backwards, right?  Well, not if the errors are due 
to one particular kind of bug.

I think Graphics.DrawImage is forgetting to pin a pointer before calling a 
Win32 API.  I think the garbage collector is collecting stuff that the Win32 
API thought it was going to use.
Date:Thu, 23 Aug 2007 15:02:42 +0900   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us