chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Memory allocation and limits in chicken scheme programs


From: Matt Welland
Subject: [Chicken-users] Memory allocation and limits in chicken scheme programs
Date: Wed, 13 Dec 2017 11:13:54 -0700

I'm using Chicken 4.10.0 and with the below script chicken rapidly allocates memory then seems to get stuck:

=====script=====
(define start-time (current-milliseconds))
(define max-n 200)
(let loop ((n       0)
           (stuff  '()))
  (let ((bigvec (make-vector 1000000 0)))
    (print n " Elapsed time: " (/ (- (current-milliseconds) start-time) 1000) " s ")
    (if (< n max-n)
        (loop (+ n 1)(cons bigvec stuff)))))
=====end script=====

On a machine with lots of memory, nothing in cache or buffers:

> free -g; utils/memproblem-simple
             total       used       free     shared    buffers     cached
Mem:          1009         13        996          0          1          1
-/+ buffers/cache:         10        999
Swap:          512          0        511

The program chokes after 133 rounds through the loop. No "out of memory' message. The process memory usage doesn't seem to grow and the program just hangs. I added -B: but didn't get any output. 

Suggestions on what might cause this and if so how to work around it or how to debug further?
 
0 Elapsed time: 0.007 s 
1 Elapsed time: 0.027 s 
2 Elapsed time: 0.031 s 
...
131 Elapsed time: 2.09 s 
132 Elapsed time: 2.093 s 
133 Elapsed time: 2.768 s 
^C
(I gave up waiting)

reply via email to

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