<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>18 May 2018 20:33:04 Z</lastBuildDate><pubDate>14 May 2018 20:03:26 Z</pubDate><description>Hello all, if anyone could give me any hints on how to solve the memory leak issue I am having it would be much appreciated. I will try to describe my scenario as best as possible. I am a web developer mostly, so things like memory management I am not very familiar with.&#13;
&#13;
I am tasked with scraping data from a website (employer insisted with Windev). I have created two classes to handle the parsing of HTML and the DOM queries.&#13;
&#13;
With threads, I have managed to get the application to process a little over 20 pages per second. The problem is that the application continues to build used memory and even after it has completed, the memory is not freed.&#13;
&#13;
Here are the classes:&#13;
&#13;
stAttribute is Structure&#13;
	sName is string&#13;
	sValue is string&#13;
END&#13;
HTMLElement is a Class&#13;
	m_nId is int // internal unique numerical ID for this element&#13;
	m_sTag is string // the html tag&#13;
	m_sContent is string // the contents, formatted to have child elements replaced with &lt;ID&gt;&#13;
	m_arrParents is array of int // array of numeric IDs of heiarchial parent elements&#13;
	m_arrChildren is array of int // array of IDs of direct decendant elements&#13;
	m_arrAllChildren is array of int // array of ALL decendant elements&#13;
	m_arrAttributes is array of stAttribute dynamic // array of structure representing attributes&#13;
	m_pclDocument is HTMLDocument dynamic // reference to document class containing array of other elements&#13;
END&#13;
HTMLDocument is a Class&#13;
	m_sOriginal is string // raw html, for debugging&#13;
	m_arrElements is array of HTMLElement dynamic // flat array of classes representing all of the elements&#13;
	m_nElementInt is int = 1 // iternal incremental numeric ID to represent each element&#13;
	m_arrSelfClose is array of string // array of html tags that are self-closing&#13;
END&#13;
&#13;
I have taken care to ensure that every class declaration is dynamic. &#13;
I only declare variables at the beginning of the functions, as to avoid the issue with loops. &#13;
I am manually deleting the HTMLDocument class at the end of my function, I would assume that would also delete all the HTMLElements contained within it. I had tried also deleting them in the destructor function, but it did not seem to make a difference.&#13;
&#13;
Now, the Document class contains an array of Elements, and the element class contains a reference back to the Document. Could that be a potential issue?</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue/read.awp</link><title>Trying to solve a memory leak issue</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>Darryl MEGANOSKI</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65519/read.awp</comments><pubDate>18 May 2018 20:33:04 Z</pubDate><description>For anyone interested now or in the future, it seems to be more related to the execution of threads rather than the classes. &#13;
&#13;…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65519/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65519/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue/read.awp">Trying to solve a memory leak issue</source><title>Re: Trying to solve a memory leak issue</title></item><item><author>Darryl MEGANOSKI</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65464/read.awp</comments><pubDate>15 May 2018 19:53:34 Z</pubDate><description>Okay, So I'm getting the weirdest behavior from tests now, and I hope someone can shed some light on why this would be the case.…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65464/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65464/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue/read.awp">Trying to solve a memory leak issue</source><title>Re: Trying to solve a memory leak issue</title></item><item><author>Darryl MEGANOSKI</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65461/read.awp</comments><pubDate>15 May 2018 16:23:40 Z</pubDate><description>Yes, I meant the variables that hold the classes are typed as dynamic when I create instances of them. Sorry for the confusion. …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65461/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65461/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue/read.awp">Trying to solve a memory leak issue</source><title>Re: Trying to solve a memory leak issue</title></item><item><author>fromweb</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65458/read.awp</comments><pubDate>14 May 2018 23:55:53 Z</pubDate><description>Hi Darryl,&#13;
&#13;
&gt; I have taken care to ensure that every class declaration is dynamic. I &#13;
&#13;
That cannot be correct. A class decla…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65458/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue-65458/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65454-trying-solve-memory-leak-issue/read.awp">Trying to solve a memory leak issue</source><title>Re: Trying to solve a memory leak issue</title></item></channel></rss>
