![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm loading several images from a database into memory, and when I do this the memory usage for the process goes up in task manager by the size of the bmp. After loading the image, I run the following code: Bitmap bitmap = (System.Drawing.Bitmap)databaseBitmap.Clone(); Graphics graphics = Graphics.FromImage(bitmap); The result of this code drops the process memory usage and the system memory usage. I'm trying to figure out why, the only thing I can come up with is that the memory is being pushed to the video card... Any ideas what is going on? |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Hi Jaret, Welcome to the MSDN newsgroup. As for the memory behavior when calling the .NET Bitmap and Graphics class's method, they're depending on the internal implementation and are not documented. So generally such behavior is not reliable and it not definitely deterministic. I think the video card memory could be one possible reason, and since both Bitmap.Clone and Graphics.FromImage call will need to allocate memory block for new objects, the system may swap some physical memory into system memory paging file, thus the private bytes used may drop some. Regards, Steven Cheng Microsoft Online Support Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.) |
#5
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |