out of memory

out of memory

am 28.11.2007 05:57:27 von aniait

Is there any way to solve the 'out of memory exception' of perl on
windows? I got this when i tried to dump a large hash into a file
using Dumper.

Re: out of memory

am 28.11.2007 06:56:47 von smallpond

On Nov 27, 11:57 pm, aniait wrote:
> Is there any way to solve the 'out of memory exception' of perl on
> windows? I got this when i tried to dump a large hash into a file
> using Dumper.


Do you have to use Dumper on the whole hash?

What's wrong with:

foreach my $key (keys %myhash) {
print FH $key,":",$myhash{$key}, "\n";
}

or even:

foreach my $key (keys %myhash) {
print FH "KEY=",$key,"\n", Dumper($myhash{$key}),"\n";
}

Re: out of memory

am 28.11.2007 14:54:25 von Ted Zlatanov

On Tue, 27 Nov 2007 20:57:27 -0800 (PST) aniait wrote:

a> Is there any way to solve the 'out of memory exception' of perl on
a> windows? I got this when i tried to dump a large hash into a file
a> using Dumper.

Try it with the YAML module, you may have better luck (and the results
are quite readable). In general as smallpond suggested you may just
have to do it key by key.

Ted

Re: out of memory

am 28.11.2007 23:54:17 von Ben Morrow

Quoth aniait :
> Is there any way to solve the 'out of memory exception' of perl on
> windows? I got this when i tried to dump a large hash into a file
> using Dumper.

Increase the size of your swapfile :). Windows machines usually don't
have anywhere near enough swap.

Ben