Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

This queue is for tickets about the XML-Tidy CPAN distribution.

Report information
The Basics
Id: 120296
Status: open
Priority: 0/
Queue: XML-Tidy

People
Owner: Pip [...] CPAN.Org
Requestors: jozef [...] kutej.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.16
Fixed in: (no value)



Subject: leaking memory on ->tidy()
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-23881-1487525711-1601.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 318
Download (untitled) / with headers
text/plain 318b
Hi Pip, there seems to be circular reference out there somewhere: perl -MXML::Tidy -MIO::String -lE 'while (1) { XML::Tidy->new(ioref => IO::String->new("<body><div>d</div></body>"))->tidy() }' will result in process that keeps on allocating more and more memory. XML::Tidy 1.16 XML::XPath 1.40 Best regards Jozef
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-23881-1487525711-1601.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-23881-1487525711-1601.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-21372-1497742215-1728.120296-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 505
Download (untitled) / with headers
text/plain 505b
Hello Jozef, Thank you very much for the bug report. I was just able to look into this and it appears the problem stems from every XML::XPath->findnodes() call that my Tidy module uses. Running the similar: perl -MXML::XPath -MIO::String -lE 'while (1) { XML::XPath->new(ioref => IO::String->new("<body><div>d</div></body>"))->findnodes("/") }' ... seems to demonstrate the leaking behavior is coming from Tidy's parent class. Hopefully it can be fixed there in XPath. Thanks again! -- -Pip@CPAN.Org


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.