![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Process crash when allocating memory | themezzaman | High Level Programming | 1 | 10-18-2007 06:53 PM |
| perl memory leak detector | matrixmadhan | UNIX for Dummies Questions & Answers | 4 | 12-20-2006 02:39 PM |
| Out of memory in PERL | Abhishek Ghose | Shell Programming and Scripting | 5 | 07-17-2006 04:15 AM |
| Crash and rebooting memory issues | finster | UNIX for Dummies Questions & Answers | 4 | 07-30-2004 03:06 AM |
| Weakness in Perl CGI causes memory dump ?? | andyj | UNIX for Advanced & Expert Users | 0 | 08-25-2003 02:09 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Perl - FileHandles that crash memory
I have a program that opens a file handle that reads a lot of logs, it uses globbing, for example ba* matches bananas.log, bank.log, etc. I have seven different names, each with several logs that I run to a grep pattern. I have subroutines for each match and a loop w/o args that processes this. When I run it I get this:
Out of memory! I went to the perl doc and tried the suggestions, but still doesn't work. Just wondering if anyone here had any experience with "Out of memory". Even if it isn't relevent to above, it would help so we don't "reinvent the wheel" (even though that's what most of us do with scripts, hehe). |
|
||||
|
grep returns a list, which means it reads the entire file/folder of whatever you grep. If the files are big you are just simply running out of physical memory because perl will use all the memory the system has available. In this case you probably do have to rewrite some code to use less memory, such as: Code:
open(FH,'file');
while(<FH>) {
search for whatever
}
}
close FH;
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|