Subject: | memory hog bug |
Date: | Tue, 13 Jun 2017 04:44:04 +0000 |
To: | "bug-PHP-Serialization-XS [...] rt.cpan.org" <bug-PHP-Serialization-XS [...] rt.cpan.org> |
From: | "Hylleberg, Rune" <Rune.Hylleberg [...] otto-office.com> |
Hi,
I think I found a memory hog bug.
If I run this code
use strict;
use warnings;
use Data::Dumper;
#use PHP::Serialization qw(serialize unserialize);
use PHP::Serialization::XS qw(serialize unserialize);
my $_iCount = 0;
while ($_iCount++ < 100000) {
my $str = serialize({'test1' => {'deep' => 'hash', 'with' => ['a', 'r', 'r', 'a', 'y']}, 'test2' => 'done'});
my $href = unserialize($str);
if (! ($_iCount % 1000)) {
open(my $fh, "<", "/proc/$$/status");
while (my $_sLine = <$fh>) {
print $_iCount.' - '.$_sLine if $_sLine =~ /VmSize:\s(.)/;
}
close $fh;
}
}
The memory usage goes up, whereas if I use PHP::Serialization it is steady.
(Tested on Suse perl 5.10 and Redhat perl 5.16)
Cheers
Rune Hylleberg
Programmer
OTTO Office GmbH & Co KG · Fabriciusstr. 105a · 22177 Hamburg
Telefon: +49 40-650 44-462 · Fax: +49 40-650 4458-462
Rune.Hylleberg@otto-office.com<mailto:Rune.Hylleberg@otto-office.com> · www.otto-office.com<http://www.otto-office.com>
--
Sitz der Gesellschaft: Fabriciusstr. 105a · 22177 Hamburg · AG Hamburg · HRA 90433
Persönlich haftend: Verwaltungsgesellschaft OTTO Office mbH · AG Hamburg · HRB 62764
USt.-ID-Nr. DE185856673 · Geschäftsführer: Uwe Orgas (Vorsitzender) · Roy Vieregge
Ein Unternehmen der Hans R. Schmid Holding AG