Solved

THyperparse memory leak

Posted on 2003-12-09
2
233 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now