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
Solved

THyperparse memory leak

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

766 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