# Demonstration of memory leak in Clarion CPXML procedure - PTSS#40365

**URL:** <https://clarionhub.com/t/demonstration-of-memory-leak-in-clarion-cpxml-procedure-ptss-40365/500>\
**Category:** code\
**Created:** [December 23, 2015, 8:58pm UTC](https://clarionhub.com/t/demonstration-of-memory-leak-in-clarion-cpxml-procedure-ptss-40365/500 "2015-12-23T20:58:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brahn](https://clarionhub.com/user_avatar/clarionhub.com/brahn/32/756_2.png) [@brahn](https://clarionhub.com/u/brahn)\
**Post date:** [December 23, 2015, 8:58pm UTC](https://clarionhub.com/t/demonstration-of-memory-leak-in-clarion-cpxml-procedure-ptss-40365/500/1 "2015-12-23T20:58:27Z")

</div>

In case you are curious:

> **[Problem-Tracker Support System](http://problemtracker.softvelocity.com/clarion8/UpdtCustBugsview.php?ID1=40365)**

CPXML appears to have a memory leak in the toDOM:AppendCol procedure. Below is a program that demonstrates this.

Calling GroupToDom with the default for DOMStyle appears to be fine (no memory leak):

`Doc &= GroupToDOM(myGroup, 'root', 'label')`

 ![image](https://clarionhub-uploads.s3.dualstack.eu-north-1.amazonaws.com/original/2X/8/8bde0812eee9f1324a05bce45acc668eec759958.png)

However, when you change the DOMStyle you very quickly see the memory usage spike:

`Doc &= GroupToDOM(myGroup, 'root', 'label', DOMStyle:ADO_NET)`

 ![image](https://clarionhub-uploads.s3.dualstack.eu-north-1.amazonaws.com/original/2X/e/e7c3950bb8b3f28bc0f549d2cbb804c7c7ef9cea.png)

### Example program:

> <https://gist.github.com/fushnisoft/74f5ff65c2e9cb1e1551>

### Possible fix:

> <https://gist.github.com/fushnisoft/66cbf633609ddf46376a>
