in reply to Out of Memory..
Strawberry Perl is a 32bit application so it can address and use at most 4GB of memory.
Your estimation of only 2.4GB required memory is optimistic - I don't see that String::Diff will not make a copy of $b1 and $b2.
You could try to reduce memory fragmentation and improve speed by reading the files in one go instead of reading them line by line:
$b1 = do { local $/; <$f1_p> };
But I suggest you find another way to achieve what you really want. Which you haven't told us yet. For example, if you want to weed out lines that are common between the two files, a tied hash can work, as tied hashes can be stored on disk, see DB_File.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Out of Memory..
by ikegami (Patriarch) on Dec 15, 2009 at 15:26 UTC | |
|
Re^2: Out of Memory..
by RobinV (Sexton) on Dec 15, 2009 at 09:17 UTC | |
by Corion (Patriarch) on Dec 15, 2009 at 09:23 UTC | |
by RobinV (Sexton) on Dec 15, 2009 at 09:29 UTC |