lkml.org 
[lkml]   [1999]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
SubjectRe: Out of memory -- System halted (with PATCH for heap size)
On Thu, 22 Jul 1999, Bob_Tracy wrote:

> Matthias Hanisch wrote:
> > > On Wed, 21 Jul 1999, Bob_Tracy wrote:
> > > > "Out of memory -- System halted".
> >
> > The cause of the problem was that the huffman
> > code lookup table grew too much with some byte patterns in the kernel
> > image. Minimal changes in kernel source code made the problem disappear.
> > I second this to raise the heap size a bit (IMHO 0x2400 should be enough).
>
> That took care of the problem. Evidently, what Matthias described is
> exactly what occurred when I added the Cyrix coma bugfix code back into
> 2.3.10, i.e., the kernel compression characteristics were changed just
> enough to allow things to work. The same trick wasn't effective to
> allow 2.3.11 to boot in my case.
>
> Let's *do* raise the heap size a bit. 0x3000 was effective for me.
> Didn't try a smaller increment.
>
> FYI, the problem has shown up on another machine I use that has the
> "officially blessed" compiler setup: gcc-2.7.2.3. This isn't a gcc
> issue, nor is it a Cyrix-specific issue as I originally thought.


FYI, too, I've looked through my archives and here is a little patch for
gzip's inflate.c (not the kernel inflate.c!!) which prints the needed
amount of heap memory for a gzip archive to stderr.

So you can test it with your kernel images (on $$tmppiggy.gz, just remove
the deletion command in arch/i386/boot/compressed/Makefile)...

BTW, zlib has a limit of 1440 for huffman table length, which means we
should have a heap size of 0x2d00 (8 bytes for struct huft).

Patch is attached (against 2.2.5, but this shouldn't matter...).

Matze

P.S.: I've tested some arbitrary gzip files on my machine and a usage of
more than 8k heap occurs amzingly often (> 2%)...

--
Matthias Hanisch office: matze@camline.com private: matze@pingu.franken.de
+49 8137 935-219 +49 8441 82387

"CAPS - Software from Experts for Experts"
--- inflate.c.orig Thu Jul 22 13:38:56 1999
+++ inflate.c Thu Jul 22 13:46:53 1999
@@ -947,8 +947,7 @@


/* return success */
-#ifdef DEBUG
- fprintf(stderr, "<%u> ", h);
-#endif /* DEBUG */
+ fprintf(stderr, "<%u> hufts, <%u> heap size needed\n",
+ h, h * sizeof(struct huft));
return 0;
}--- linux/arch/i386/boot/compressed/misc.c.orig Thu Jul 22 14:09:24 1999
+++ linux/arch/i386/boot/compressed/misc.c Thu Jul 22 14:10:35 1999
@@ -104,7 +104,7 @@
#define LOW_BUFFER_START 0x2000
#define LOW_BUFFER_END 0x90000
#define LOW_BUFFER_SIZE ( LOW_BUFFER_END - LOW_BUFFER_START )
-#define HEAP_SIZE 0x2000
+#define HEAP_SIZE 0x2d00 /* same as in zlib */
static int high_loaded =0;
static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/;
\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.058 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site