Solved

THyperparse memory leak

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

808 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