chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] Prevent excessive major gcs by having decent amount of u


From: megane
Subject: Re: [PATCH 1/2] Prevent excessive major gcs by having decent amount of unused heap
Date: Wed, 20 Jan 2021 17:48:42 +0200
User-agent: mu4e 1.0; emacs 27.1

Sven Hartrumpf <hartrumpf@gmx.net> writes:

> Hello.
>
[snip]
>> I need some -:hi option (only for the new GC!), otherwise it crashes as 
>> follows:
>>
>>   # nallch.x32 -:a0 -:o -:s4096k 0
>> [panic] out of memory - cannot allocate next heap segment - execution 
>> terminated
>
> I have experimented some more (with x32 binaries).
> I am now running my binary with:
>
> -:a0 -:hiNNNm -:hm3900m -:o -:s4096k
>
> Then, I tried several values NNN for -:hiNNNm.
> crashes: 2 6 7 8 16
> ok: 3 4 5
>
> I added (set-gc-report! #t) and attach a complete log from a crashing run 
> with NNN=6.
>

I think you're having unlucky combination of limited memory and initial
heap size. If I understand correctly, you should be able to get the same
error without the patches too with some -:hi values.

You could try seeing if -:hg150 helps the situation.

Btw, how much memory does the machine have?

Here's a small program and a script to test how much memory you can
allocate with different initial heap sizes:

;;; FILE: foo.scm
(import (chicken blob))
(define foo '())
(let l ([tot 0] [s 1000000])
  ;; (print "at " tot " " s)
  (set! foo (cons (make-blob s) foo))
  (l (+ s tot) (min 100000000 (inexact->exact (round (* s 1.4))))))
;;; RUN:

;;; FILE: run.sh
#!/usr/bin/env bash
csc5 foo.scm
for HI in $(seq 16); do
 echo -n "AAAA -:hi${HI}M"
 (./foo -:g -:hi${HI}M -:hg150 2>&1) | grep -E '(at |resized)' | tail -n 1
 echo -n "B -:hi${HI}M"
 (./foo -:g -:hi${HI}M -:hg200 2>&1) | grep -E '(at |resized)' | tail -n 1
done

If I run this with ulimit -v 1048576 I get maximal heap sizes ranging
from 509573502 to 1007797006 bytes w/o the patches, and
518025406-1024700814 with the patches.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]