<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: grep: not enough memory ??? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672200#M51151</link>
    <description>maxdsiz&lt;BR /&gt;0x04000000&lt;BR /&gt;Calculated Value:  67108864 &lt;BR /&gt;&lt;BR /&gt;ulimit -d&lt;BR /&gt;65536&lt;BR /&gt;&lt;BR /&gt;Do I need to bump ulimit?&lt;BR /&gt;And will a cat file | grep whatever &lt;BR /&gt;use allot of cpu ?&lt;BR /&gt;&lt;BR /&gt;Richard</description>
    <pubDate>Wed, 27 Feb 2002 04:20:56 GMT</pubDate>
    <dc:creator>someone_4</dc:creator>
    <dc:date>2002-02-27T04:20:56Z</dc:date>
    <item>
      <title>grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672198#M51149</link>
      <description>Hello everyone ..&lt;BR /&gt;seems I am starting eat live and dream HPUX .. fun huh ..&lt;BR /&gt;Well we are trying to cat and grep a huge file.&lt;BR /&gt;154082574 Feb 26 21:50 radius.log&lt;BR /&gt;When I try  to grep .. I get this error&lt;BR /&gt;cat radius.log | grep spr8345409a1&lt;BR /&gt;grep: not enough memory&lt;BR /&gt;&lt;BR /&gt;I can grep a smaller file but I cant get that big file. Does grep have limits? Any other way to look for a string in a huge file?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Richard&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Feb 2002 03:58:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672198#M51149</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2002-02-27T03:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672199#M51150</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try this perl script:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;open (FILE, "radius.log");&lt;BR /&gt;&lt;BR /&gt;while (&lt;FILE&gt;)&lt;BR /&gt;{&lt;BR /&gt;  if /spr8345409a1/&lt;BR /&gt;  {&lt;BR /&gt;     print "$_\n";&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Btw, what is your maxdsiz and ulimit?&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong&lt;/FILE&gt;</description>
      <pubDate>Wed, 27 Feb 2002 04:02:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672199#M51150</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-02-27T04:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672200#M51151</link>
      <description>maxdsiz&lt;BR /&gt;0x04000000&lt;BR /&gt;Calculated Value:  67108864 &lt;BR /&gt;&lt;BR /&gt;ulimit -d&lt;BR /&gt;65536&lt;BR /&gt;&lt;BR /&gt;Do I need to bump ulimit?&lt;BR /&gt;And will a cat file | grep whatever &lt;BR /&gt;use allot of cpu ?&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Wed, 27 Feb 2002 04:20:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672200#M51151</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2002-02-27T04:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672201#M51152</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Does the perl script work for you? If it worked, then it was probably a grep limitation.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Wed, 27 Feb 2002 04:55:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672201#M51152</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-02-27T04:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672202#M51153</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I would first try:&lt;BR /&gt;grep "spr8345409a1" radius.log&lt;BR /&gt;&lt;BR /&gt;If this comes back with "not enough memory" then try feeding it to xargs like this:&lt;BR /&gt;&lt;BR /&gt;ls radius.log|xargs grep "spr8345409a1"&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Wed, 27 Feb 2002 05:39:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672202#M51153</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-02-27T05:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672203#M51154</link>
      <description>no the perl script spit out some errors. &lt;BR /&gt;&lt;BR /&gt;syntax error at ./perl.scr line 5, near "if /spr8345409a1/"&lt;BR /&gt;syntax error at ./perl.scr line 9, near "}"&lt;BR /&gt;Execution of ./perl.scr aborted due to compilation errors.&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Wed, 27 Feb 2002 15:19:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672203#M51154</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2002-02-27T15:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672204#M51155</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This could be swap so check your syslog.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also try the old do loop to slow it down&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cat file|while read line&lt;BR /&gt;do&lt;BR /&gt;echo $line|grep spr8345409a1 &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;               Steve Steel</description>
      <pubDate>Wed, 27 Feb 2002 15:21:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672204#M51155</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-02-27T15:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672205#M51156</link>
      <description>To fix perl script, change "if" to-&lt;BR /&gt;&lt;BR /&gt;if ( /spr8345409a1/ )&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Feb 2002 15:23:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672205#M51156</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-02-27T15:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672206#M51157</link>
      <description>well ..&lt;BR /&gt;Here is what the perl script gave me ..&lt;BR /&gt;&lt;BR /&gt;./perl.scr&lt;BR /&gt;Out of memory during "large" request for 67112960 bytes at ./perl.scr line 3.</description>
      <pubDate>Wed, 27 Feb 2002 15:29:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672206#M51157</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2002-02-27T15:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672207#M51158</link>
      <description>This out of memory condition might be caused by no ^j (new line) in the file. grep and perl are record processing utilities.&lt;BR /&gt;&lt;BR /&gt;If this is the case, you can use perl to do binary reads, reading in a block at a time and scanning that block.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 27 Feb 2002 15:38:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672207#M51158</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-02-27T15:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672208#M51159</link>
      <description>You're maxdsize is pretty small (still at the default, I believe), although it seems strange that grep would be causing those kinds of problems.&lt;BR /&gt;&lt;BR /&gt;Is this a binary file?  Grep is suppposed to be line oriented and I know I have grepped things out of files in the 1 to 2 gig range, but they were text files with newline characters embedded.</description>
      <pubDate>Wed, 27 Feb 2002 15:45:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672208#M51159</guid>
      <dc:creator>Eric Ladner</dc:creator>
      <dc:date>2002-02-27T15:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672209#M51160</link>
      <description>If this is on HP-UX 10.20, then there are (customer) reports that grep patch PHCO_13451 *might* help. However your scenario is not specifically mentioned in the .txt file of the patch.&lt;BR /&gt;&lt;BR /&gt;Other reports indicate that maxdsiz should be greater than the file's size, which, as far as I can tell is not the case in your case.&lt;BR /&gt;&lt;BR /&gt;Yet other reports use split(1) to split the file into smaller pieces and grep the pieces. May be you can use this trick to see if maxdsiz is indeed the likely culprit.&lt;BR /&gt;&lt;BR /&gt;Just to be sure: This is a *text* file, right? I.e. a file with lines ending with a newline character and with line lengths less than 2048 bytes (see glossary(9) and limits(5)). If not,you may want to use fold(1).</description>
      <pubDate>Thu, 28 Feb 2002 10:36:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672209#M51160</guid>
      <dc:creator>Frank Slootweg</dc:creator>
      <dc:date>2002-02-28T10:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672210#M51161</link>
      <description>&lt;A href="http://hpux.tn.tudelft.nl/hppd/hpux/Gnu/grep-2.5a/" target="_blank"&gt;http://hpux.tn.tudelft.nl/hppd/hpux/Gnu/grep-2.5a/&lt;/A&gt; is the GNU version of grep, which might help you out.&lt;BR /&gt;&lt;BR /&gt;With all those memory requirements passing by, a question might be apropriate: Are the `lines' in radius.log separated by newlines, or by something else? If there are no newlines, most unix utilities will fail, because they work line based.&lt;BR /&gt;&lt;BR /&gt;GNU grep works block based, and perl works line based by default, but can easily be told to work block based or accept any record separator you like.&lt;BR /&gt;&lt;BR /&gt;with perl you might get better results in setting the input record separator to something /not/ in the pattern. But that still leaves the question: what should be printed if the lines are not newline separated?&lt;BR /&gt;&lt;BR /&gt;perl -ne '/spr8345409a1/ and print' radius.log&lt;BR /&gt;&lt;BR /&gt;for a much simpler version than all perl examples given, and a safer version could be&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Steven's version has some bugs (apart from the missing () in the if):&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;open (FILE, "radius.log");&lt;BR /&gt;&lt;BR /&gt;while (&lt;FILE&gt;) {&lt;BR /&gt;  if (/spr8345409a1/) {&lt;BR /&gt;    print "$_\n";&lt;BR /&gt;    }&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;1. open FILE, "&amp;lt; radius.log" or die "radius.log: $!";&lt;BR /&gt;   always check the return status of the open, reading from a not opened handle might be surprising&lt;BR /&gt;   always open files for reading using "&amp;lt;" in front to prevent strange and unwanted effects:&lt;BR /&gt;&lt;BR /&gt;   my $x = "radius.log"&lt;BR /&gt;   open LOGFILE, $x;&lt;BR /&gt;&lt;BR /&gt;   care to think what would happen if $x came from the outside world and contains "| xargs rm -rf /"?&lt;BR /&gt;&lt;BR /&gt;2. print;&lt;BR /&gt;&lt;BR /&gt;   perl reads /lines/ separated by newlines (at least on unix) but does not strip them, so $_ still has the newline at the end. $_ also is the default to print, so 'print;' should suffice in this case.&lt;BR /&gt;&lt;/FILE&gt;</description>
      <pubDate>Thu, 28 Feb 2002 13:19:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672210#M51161</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-02-28T13:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: grep: not enough memory ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672211#M51162</link>
      <description>Richard,&lt;BR /&gt;&lt;BR /&gt;I was just goinf to suggest you getting GNU's grep, but procura beat me to it. Like stated, it will do block scans. The issue is also that you are trying to "display" the "block" of data containing your "string", and if the start of this block (last NewLine) was a few meg's ago (and let's not forget where the block ends - yes, at the next NewLine), you are going to get a lot of crap on your screen. &lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 28 Feb 2002 13:56:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-not-enough-memory/m-p/2672211#M51162</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-02-28T13:56:51Z</dc:date>
    </item>
  </channel>
</rss>

