Click here to Skip to main content
15,915,093 members
Home / Discussions / C#
   

C#

 
Questionbitmap speed question [modified] Pin
likefood24-May-06 12:50
likefood24-May-06 12:50 
AnswerRe: bitmap speed question [modified] Pin
Christian Graus24-May-06 14:05
protectorChristian Graus24-May-06 14:05 
GeneralRe: bitmap speed question [modified] Pin
likefood24-May-06 14:10
likefood24-May-06 14:10 
GeneralRe: bitmap speed question [modified] Pin
likefood25-May-06 5:13
likefood25-May-06 5:13 
QuestionSound Control Pin
alias bill24-May-06 12:39
alias bill24-May-06 12:39 
AnswerRe: Sound Control Pin
mav.northwind24-May-06 22:57
mav.northwind24-May-06 22:57 
AnswerRe: Sound Control Pin
Cary Zhang25-May-06 0:33
Cary Zhang25-May-06 0:33 
QuestionMemory friendly way to add to listbox? Pin
Dan Neely24-May-06 10:21
Dan Neely24-May-06 10:21 
I'm logging data to a listbox at a fairly rapid rate (10-100x /sec). THe problem is that after a few minutes my apps memory usage resembles a sawtooth wave with lows of 20-40megs and peaks of several hundred megs, each peak is typically larger than the preceding one until they get to about 250megs at which point the peaks size levels off. From saving out the logdata to a textfile, it's ~0.1% of the size of the memory usage peaks. My suspicion of what's happening is that each time I add an element to the listbox the entire Items list is destroyed and recreated. This would give the growth of several megs/second with periodic garbage collects being the large drops.

If I comment out the add line, my memory usage stays in the low double digit megabytes, so I'm fairly certain it's the listbox that's too blame. Is there anyway to do the updates without abusing the GC this badly, or do I need to rethink my logging and display approach?

lb.TopIndex = lb.Items.Add(timestamp + eventText);
AnswerRe: Memory friendly way to add to listbox? Pin
mav.northwind25-May-06 0:20
mav.northwind25-May-06 0:20 
QuestionRegEx Parsing? Pin
econner24-May-06 10:17
econner24-May-06 10:17 
AnswerRe: RegEx Parsing? Pin
Ed.Poore24-May-06 12:36
Ed.Poore24-May-06 12:36 
QuestionSymbol Font question Pin
Wjousts24-May-06 10:05
Wjousts24-May-06 10:05 
AnswerRe: Symbol Font question Pin
Wjousts24-May-06 11:10
Wjousts24-May-06 11:10 
Questiona question about printing or saving data in datagridview ? Pin
cmpeng3424-May-06 10:01
cmpeng3424-May-06 10:01 
AnswerRe: a question about printing or saving data in datagridview ? Pin
maryamf24-May-06 12:26
maryamf24-May-06 12:26 
QuestionComputer names Pin
Elvis_Pretzelator24-May-06 9:30
Elvis_Pretzelator24-May-06 9:30 
AnswerRe: Computer names Pin
Wjousts24-May-06 9:59
Wjousts24-May-06 9:59 
GeneralRe: Computer names Pin
Elvis_Pretzelator24-May-06 13:58
Elvis_Pretzelator24-May-06 13:58 
AnswerRe: Computer names Pin
alexey N24-May-06 17:49
alexey N24-May-06 17:49 
QuestionOrg.Mentalis.Security version for pocket PCs [modified] Pin
msolh24-May-06 9:10
msolh24-May-06 9:10 
Question[VS.NET 2005] where is csc.exe? Pin
Susuko24-May-06 9:03
Susuko24-May-06 9:03 
AnswerRe: [VS.NET 2005] where is csc.exe? Pin
Dustin Metzgar24-May-06 9:10
Dustin Metzgar24-May-06 9:10 
AnswerRe: [VS.NET 2005] where is csc.exe? Pin
mav.northwind24-May-06 23:02
mav.northwind24-May-06 23:02 
QuestionHow to create customize buttons easy? Pin
conemajstor24-May-06 8:47
conemajstor24-May-06 8:47 
QuestionI want to terminate my app. after a specific Pin
mostafa_h24-May-06 8:45
mostafa_h24-May-06 8:45 

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.