开发者

.net memory management in my app (datagridviews)

开发者 https://www.devze.com 2023-02-19 12:03 出处:网络
I was wondering if I\'m missing something.I have a pretty complex app, but the core of it is this: I query a database, which returns 10k-ish entries.

I was wondering if I'm missing something. I have a pretty complex app, but the core of it is this:

I query a database, which returns 10k-ish entries.

I store those entries in a custom business object.

Those objects are added to a BindingListView, and bound to a datagridview.

Now, over time, (40+ queries), my memory usage continually rises, to the point where I get an OutOfMemoryException at around the 42nd query.

I'm wondering I'm not deleting something or have a memory leak. I'm 100% sure every single business object is properly deleted before the next query starts. I really 开发者_如何学运维do think all my memory (1.5gig at the time the app dies usually), are all datagridview rows.

To note: I'm using .net 2.0, visual c++ running VS2008


Make sure to wrap ALL your db calls and data readers in using statements to make sure they are disposed of properly

0

精彩评论

暂无评论...
验证码 换一张
取 消