Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - CRITICAL memoryleak using Databind
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CRITICAL memoryleak using Databind

 Post Reply Post Reply
Author
Message
CapoPezzio View Drop Down
Groupie
Groupie


Joined: 13 April 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapoPezzio Quote  Post ReplyReply Direct Link To This Post Topic: CRITICAL memoryleak using Databind
    Posted: 24 September 2010 at 9:04am
I have had a problem with memory-leak in my application using Reportcontrol and Databind.
And I have found that in Codejocks own example too, the one called ReportDataBinding, there is a memoryleak there as well. If you run the example and swithing between Tables on the left side, you can see in Task Manager that Memory on VB6 goes up and up. If you stand on Event and switch to another table and then back to Event, you will see memory goes up. Do this several times and you see my point. In my application I have much larger datasets and the leak is bigger.

This is VERY CRITICAL to us. Is this a known problem, has it been fixed in later versions and is there a workaround???

PLEASE reply
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 24 September 2010 at 9:30am
The memory usage in the task manager doesn't say anything about memory leaks. Also I've just tested the sample and there is no memory leak.


Codejock support
Back to Top
CapoPezzio View Drop Down
Groupie
Groupie


Joined: 13 April 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapoPezzio Quote  Post ReplyReply Direct Link To This Post Posted: 24 September 2010 at 9:45am
We are two person in our company who runs the example on two different computeres and both experience the same. It is the same in our business application, we use the same prosedure to set up the ReportControl. With larger datasets the leak is larger. Wich version are you using?
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 24 September 2010 at 10:26am
Again, the task managers "memory usage" doesn't say anything about real memory usage, it shows the process working set.

For example msdev.exe shows 13 MB memory usage. If I minimize the window it drops to 3 MB.

Codejock support
Back to Top
CapoPezzio View Drop Down
Groupie
Groupie


Joined: 13 April 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapoPezzio Quote  Post ReplyReply Direct Link To This Post Posted: 24 September 2010 at 11:59am
Then I will be very interesting to learn how you monitor memory usage of an application. Refer to my application with reportcontrol and databind, I fill the controll with >100000 records, 20 columns each time. The memory usage goes up with abount 40 MB each time, and I soon reach 1 GB in task manager. Sorry, I just cant sit back, dont think my customeres will either, and say -Everything is ok.

Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 25 September 2010 at 5:05am
Hi,
 
And maybe CJ isn't responsable for this... Maybe checkout Helpfile for methods:
 
FreeBatchExtraData
UseBatchAllocation
UseReportCustomHeap
 
I copy/paste the description from helpfile for UseReportCustomHeap in here so you are able to read what I mean. I don't know if it applies to "Databinding feature" as well, better ask support Wink
 

Description

Tells the report control to create its own memory heap instead of letting MFC allocate memory (In standard mode, not virtual).

Syntax

Public Function UseReportCustomHeap() As Boolean

Return Type

Returns True if the report control to creates its own memory heap to store report resources.

Remarks

Typically it should be fine to allow MFC to allocate memory, but in some cases if you are working with really large data set that you are removing and loading on a regular basis memory is not released and UseReportCustomHeap should be used.  UseReportCustomHeap tells the report control to create its own memory heap instead of letting MFC allocate memory.  This is only really needed when adding and removing large numbers of rows over and over again.  The problem is that MFC will allocate memory for the rows created, but it must create a whole page in memory and this page may also have memory for some other processes in windows, not just the report control.  So when it comes time to delete the rows the report related memory is marked for deletion, but the page can not be removed as there are other windows processes using it.  This is how MFC works and is not a bug.  This is why after deleting large amounts of records the memory does not appear to get released.  To overcome this short comming of MFC you can use UseReportCustomHeap for the report control to create its own memory heap so that it can release all memory related to the rows in the remove when they are removed.

Read red marked text, that's why I said CJ can't do anything about that. Maybe better to write to Bill Gates, I guess he is responsable Wink There's a sample what uses above methods, try it and check if memory usage increases same way.
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
CapoPezzio View Drop Down
Groupie
Groupie


Joined: 13 April 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapoPezzio Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2010 at 4:51am
Thank you for your reply Aaron. I have tried with the functions you mentioned, but it didnt help. uploads/6039/reportcontrol_memoryleak-1.zip . Here is a small example if you want to take a look. This demonstrate my problem. If you know a better way to monitor memory leak than to use the Task Manager, please let  me know.

Found this link where it says: The simplest way to find a memory leak is with the Windows Task Manager. Run the application and monitor Memory Usage and Virtual Memory Size in the Process tab or use the Windows Resource kit. A continuous increase in virtual memory, after the application has allocated all the memory it needs, indicates a memory leak. If it’s a very small and subtle memory leak, it would take some hours to identify, but its well worth the effort.

http://www.drdobbs.com/184416404

I have posted to Support today and waiting for an answer
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2010 at 10:44am

Hi,

Still no answer? I tried with sample from CodeJock site http://www.codejock.com/downloads/samples/reportcontrol.asp and seems same thing. Sometimes memory isn't released (still using TaskManager) adding a few times 20.000 records (batch and usual) and after remove all, still few Mb missing. After exiting app these Mb's are released.
 
To support: Can someone explain to us poor VB users how to monitor this properly and why memory isn't released even with Customheap and BatchAllocation? I would be very happy if someone could explain it to us.  
 
Thanks
     
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
CapoPezzio View Drop Down
Groupie
Groupie


Joined: 13 April 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapoPezzio Quote  Post ReplyReply Direct Link To This Post Posted: 14 October 2010 at 2:36am
Hi,
I still have got no answer. Maybe because I only bought a 30 day subscription back in April this year, they dont answer me, I dont know. But the problem is there to see
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0
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: 14 October 2010 at 9:11am
There's a memory leak in MSJet40.dll if you update a field in a record of type SQL_LONGVARCHAR.

We found this by writing our own memory tracker, which thunks calls to VirtualAlloc and VirtualFree so we could track (and get stack of allocation) leaks.  

Are you perchance accessing an MDB file for your database?
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 16 October 2010 at 3:00am
Originally posted by adrien adrien wrote:

 
[...]
We found this by writing our own memory tracker, which thunks calls to VirtualAlloc and VirtualFree so we could track (and get stack of allocation) leaks.  

[...]
 
 
Hi,
 
Would you be so kind and share your "memory tracker application" ?
 
If not, check this @CapoPezzio: http://www.codeproject.com/KB/threads/ProSysLib3.aspx
and maybe usefull to CodeJock also Wink 
 
To support: Why don't you reply on this post? C'mon, if this is a bug just say so !!! and if you are convinced that it isn't and "we" are doing something wrong, just say so.
 
Thanks
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
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.141 seconds.