Click here to Skip to main content
15,889,462 members
Home / Discussions / C#
   

C#

 
AnswerRe: Read from process Pin
Luc Pattyn13-Jun-09 10:12
sitebuilderLuc Pattyn13-Jun-09 10:12 
GeneralRe: Read from process Pin
thomaxz.tc13-Jun-09 12:29
thomaxz.tc13-Jun-09 12:29 
GeneralRe: Read from process Pin
Luc Pattyn13-Jun-09 12:37
sitebuilderLuc Pattyn13-Jun-09 12:37 
GeneralRe: Read from process Pin
thomaxz.tc13-Jun-09 12:47
thomaxz.tc13-Jun-09 12:47 
GeneralRe: Read from process Pin
Luc Pattyn13-Jun-09 13:37
sitebuilderLuc Pattyn13-Jun-09 13:37 
GeneralRe: Read from process Pin
thomaxz.tc13-Jun-09 23:32
thomaxz.tc13-Jun-09 23:32 
Questionload a lot of Images to memory Pin
nryk13-Jun-09 8:57
nryk13-Jun-09 8:57 
AnswerRe: load a lot of Images to memory Pin
Luc Pattyn13-Jun-09 9:37
sitebuilderLuc Pattyn13-Jun-09 9:37 
Hi,

several remarks:

1.
Image size (the file or memory footprint) depends on the image format; e.g. ImageFormat.Jpeg would be more economical than ImageFormat.Png due to the compression used.

2.
When a class offers a public Dispose() method, you should call it as soon as you are done with the object. MemoryStream is one of those.

3.
you must be aware that, the way you do things, causes each image to exist several times in memory, and being copied from one format to another: byte[], MemoryStream, Image

4.
are you sure you need byte arrays at all? maybe you could perform image operations on the MemoryStream directly. OTOH you might consider using a Bitmap constructor that builds a Bitmap from an existing array, without copying (see the ones with an IntPtr parameter)

5.
assuming your images/streams/arrays each take more than some 80KB, they may all end up in the "huge-object-heap" which does not have compaction; as a result after several operations you may run out of memory although your memory-in-use count may well be below your working set.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.

GeneralRe: load a lot of Images to memory Pin
harold aptroot13-Jun-09 11:55
harold aptroot13-Jun-09 11:55 
GeneralRe: load a lot of Images to memory Pin
Luc Pattyn13-Jun-09 14:29
sitebuilderLuc Pattyn13-Jun-09 14:29 
GeneralRe: load a lot of Images to memory Pin
harold aptroot13-Jun-09 14:36
harold aptroot13-Jun-09 14:36 
GeneralRe: load a lot of Images to memory Pin
Luc Pattyn13-Jun-09 15:17
sitebuilderLuc Pattyn13-Jun-09 15:17 
AnswerRe: load a lot of Images to memory Pin
nryk13-Jun-09 18:05
nryk13-Jun-09 18:05 
GeneralRe: load a lot of Images to memory Pin
Dave Kreskowiak13-Jun-09 21:46
mveDave Kreskowiak13-Jun-09 21:46 
AnswerRe: load a lot of Images to memory Pin
Guffa13-Jun-09 21:26
Guffa13-Jun-09 21:26 
GeneralRe: load a lot of Images to memory Pin
nryk13-Jun-09 21:40
nryk13-Jun-09 21:40 
GeneralRe: load a lot of Images to memory Pin
harold aptroot13-Jun-09 22:38
harold aptroot13-Jun-09 22:38 
GeneralRe: load a lot of Images to memory Pin
Guffa13-Jun-09 23:30
Guffa13-Jun-09 23:30 
GeneralRe: load a lot of Images to memory Pin
nryk14-Jun-09 0:16
nryk14-Jun-09 0:16 
GeneralRe: load a lot of Images to memory Pin
Guffa14-Jun-09 21:18
Guffa14-Jun-09 21:18 
QuestionDockPanel Suite Pin
Rafone13-Jun-09 6:24
Rafone13-Jun-09 6:24 
AnswerRe: DockPanel Suite Pin
Henry Minute13-Jun-09 6:34
Henry Minute13-Jun-09 6:34 
GeneralRe: DockPanel Suite Pin
Rafone13-Jun-09 7:18
Rafone13-Jun-09 7:18 
Questioncannot load data from database to textbox in Visual c# 2008 Pin
Adekolurejo13-Jun-09 5:52
Adekolurejo13-Jun-09 5:52 
AnswerRe: cannot load data from database to textbox in Visual c# 2008 Pin
Henry Minute13-Jun-09 6:38
Henry Minute13-Jun-09 6:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.