Solved

THyperparse memory leak

Posted on 2003-12-09
2
238 Views
Last Modified: 2010-04-05
hi!

I'm using THyperParse to parse HTML files and extract information. Now the problem is that it has a memory leak: creating and destroying 100 objects takes up to ~50MB of memory when the file is large enough; according to the task manager.

Of course I could use another component (though hard to find a free one which is right for me), but time is pressing and I can't migrate the whole project just now.
Before you ask, yes I've asked the author, but he can't help me right now, because he's no time.

I've created a sample app which you can download from
http://www.hds-pad.de/dld/hyperparse-memory.zip  (which includes the component, as well).

This is quite important. If you find a solution I'll raise the # of points!


thanks a lot!
0
Comment
Question by:webers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 250 total points
ID: 9906308

Well, looking at the source code posted (which doesn't seem to quite match your project, ie Execute doesn't take any params, but your code is passing a string), the
THtmlInfo object does not cleanup its item list when the destructor is run

Should be something like...

destructor THtmlInfo.Destroy;
var  dwIndex:    Integer;
begin

  // *** Addition ***
  for dwIndex:=Pred(FParamList.Count) downto 0 do
  begin
     Dispose(PHtmlParameter(FParamList[dwIndex]));
  end;
  // *** End of addition ***

  FParamList.Free;

  inherited Destroy;

end;

Regards,
Russell
0
 

Author Comment

by:webers
ID: 9938654
lovely, I didn't know it's that simple.
(well, I don't have much of a clue of memory programming)

thanks a lot.
Heiko.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question