Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Mem leak relating to Populate call
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mem leak relating to Populate call

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: Mem leak relating to Populate call
    Posted: 17 February 2010 at 4:14pm
Hi all

We have an app that enumerates users in an Active Directory and puts the records in a Report control. There can be any number of objects from 10 to anything. We are currently testing for load with an AD with 250,000 users in it.

Normally we limit the number of records to display, but allow the user to show all. So, I'm running into trouble when adding all 250,000 records to the control.

I'm not using virtual mode.

If I add all records, then call populate, everything is fine (except see nothing for a long time), and memory is released when I call ResetContent.

However if I call Populate while adding records, memory is then not released.

I tried several methods

1. calling populate on each add. This resulted in 0 memory freed when I call ResetContent, and furthermore 0 memory freed when I even delete the control itself!!! So this is a huge leak.

2. Calling populate for every N records. This results in a leak, but there is a small amount of memory returned when ResetContent is called. So this is still a large leak.

I really need all memory to be freed, since this control is in a DLL which can be unloaded, but uses a shared heap, so the memory will leak if it's not returned.

Anything I can do? I'm reluctant to go virtual, since I need sorting and grouping.

What would be really great would be ability for records to be added and no populate call required (e.g. it adds and draws, optimised for high rate of inserts).

Also, there are horrible things happening in AddRecordEx. If you call AddRecordEx with NULL for parent, and -1 for other params, it iterates all items for no purpose. This makes it impossibly slow.



Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 17 February 2010 at 4:15pm
p.s. I've seen this on 14.0 beta, and also 13.1.0 so it's been there for a while.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.