Skip Menu |

This queue is for tickets about the OpenOffice-OODoc CPAN distribution.

Report information
The Basics
Id: 49739
Status: resolved
Priority: 0/
Queue: OpenOffice-OODoc

People
Owner: Nobody in particular
Requestors: harry [...] ice.be
Cc:
AdminCc:

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



Subject: memory problem
when is run this subroutine for 1000 times with the same template only $newfile and $change_the_text differs my program uses more and more memory until i get out of memory what is wrong ? seems like $doc is not flushed out of memory when i do a $doc->save("$output_path\\$newfile.odt") sub changeodt { my $directory = shift @_; my $template =shift @_; my $output_path =shift @_; my $newfile = shift @_; my $change_the_text = shift @_; $doc = ooDocument(file => "$directory\\$template"); $filter = "select_this_text"; $result = $doc->selectTextContent($filter, "$change_the_text"); $doc->save("$output_path\\$newfile.odt"); }
Le Mer. Sep. 16 09:43:05 2009, HarryC a écrit : Show quoted text
> when is run this subroutine for 1000 times with the same template > only $newfile and $change_the_text differs > my program uses more and more memory until i get out of memory > what is wrong ? > seems like $doc is not flushed out of memory when i do a > $doc->save("$output_path\\$newfile.odt")
Could you please add an explicit dispose instruction at the very end of the loop (see below) and try again sub changeodt { my $directory = shift @_; my $template =shift @_; my $output_path =shift @_; my $newfile = shift @_; my $change_the_text = shift @_; $doc = ooDocument(file => "$directory\\$template"); $filter = "select_this_text"; $result = $doc->selectTextContent($filter, "$change_the_text"); $doc->save("$output_path\\$newfile.odt"); $doc->dispose; }
On Wo. Sep. 16 09:59:18 2009, JMGDOC wrote: Show quoted text
> Le Mer. Sep. 16 09:43:05 2009, HarryC a écrit :
> > when is run this subroutine for 1000 times with the same template > > only $newfile and $change_the_text differs > > my program uses more and more memory until i get out of memory > > what is wrong ? > > seems like $doc is not flushed out of memory when i do a > > $doc->save("$output_path\\$newfile.odt")
> > Could you please add an explicit dispose instruction at the very end
of Show quoted text
> the loop (see below) and try again > > sub changeodt { > my $directory = shift @_; > my $template =shift @_; > my $output_path =shift @_; > my $newfile = shift @_; > my $change_the_text = shift @_; > $doc = ooDocument(file => "$directory\\$template"); > $filter = "select_this_text"; > $result = $doc->selectTextContent($filter, "$change_the_text"); > $doc->save("$output_path\\$newfile.odt"); > $doc->dispose; > }
problem solved works like a charm thks Harry
On Wo. Sep. 16 08:07:00 2009, HarryC wrote: Show quoted text
> On Wo. Sep. 16 09:59:18 2009, JMGDOC wrote:
> > Le Mer. Sep. 16 09:43:05 2009, HarryC a écrit :
> > > when is run this subroutine for 1000 times with the same template > > > only $newfile and $change_the_text differs > > > my program uses more and more memory until i get out of memory > > > what is wrong ? > > > seems like $doc is not flushed out of memory when i do a > > > $doc->save("$output_path\\$newfile.odt")
> > > > Could you please add an explicit dispose instruction at the very
end Show quoted text
> of
> > the loop (see below) and try again > > > > sub changeodt { > > my $directory = shift @_; > > my $template =shift @_; > > my $output_path =shift @_; > > my $newfile = shift @_; > > my $change_the_text = shift @_; > > $doc = ooDocument(file => "$directory\\$template"); > > $filter = "select_this_text"; > > $result = $doc->selectTextContent($filter,
"$change_the_text"); Show quoted text
> > $doc->save("$output_path\\$newfile.odt"); > > $doc->dispose; > > }
> problem solved works like a charm > thks > Harry >
Subject: Re:[rt.cpan.org #49739] memory problem
Date: Wed, 16 Sep 2009 17:09:45 +0200
To: Bugs in OpenOffice-OODoc via RT <bug-OpenOffice-OODoc [...] rt.cpan.org>
From: "harry" <harry [...] ice.be>
problem solved thanks Harry Conings