CRITICAL memoryleak using Databind |
Post Reply |
Author | |
CapoPezzio
Groupie Joined: 13 April 2010 Status: Offline Points: 25 |
Post Options
Thanks(0)
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 |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
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
|
|
CapoPezzio
Groupie Joined: 13 April 2010 Status: Offline Points: 25 |
Post Options
Thanks(0)
|
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 |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
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
|
|
CapoPezzio
Groupie Joined: 13 April 2010 Status: Offline Points: 25 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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
DescriptionTells the report control to create its own memory heap instead of letting MFC allocate memory (In standard mode, not virtual). SyntaxPublic Function UseReportCustomHeap() As Boolean
Return TypeReturns 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 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.... |
|
CapoPezzio
Groupie Joined: 13 April 2010 Status: Offline Points: 25 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
CapoPezzio
Groupie Joined: 13 April 2010 Status: Offline Points: 25 |
Post Options
Thanks(0)
|
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 |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
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?
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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
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.... |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |