English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] toplevel bogging down after a while
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-04-06 (08:46)
From: Chris Hecker <checker@d...>
Subject: [Caml-list] toplevel bogging down after a while

I tend to use this emacs macro a lot while I'm developing:

             (define-key caml-mode-map "\C-c\C-t"
               (lambda ()
                 "Eval the entire buffer with *inferior-caml*"
                 (inferior-caml-eval-region (point-min) (point-max))))

I love having a language with a toplevel, especially when I can run tk/gl apps straight out of emacs!  Groovy.

However, after about 15 or 20 runs of my 300 line labltk/lablgl app, the runtime performance of the app starts really decreasing.  If I kill the inferior-caml process, and start it up again, everything's back to normal.  

It seems like the gl-drawn mouse cursor is slowing down even more than the app, but the app definitely slows way down.

Below are some Gc.stat () calls at various times.  Is it likely that this is Gc related?  I don't know how to read the stats below and whether they're saying anything.  I don't mind restarting the inferior-caml process, but is this some problem with my app that I'm going to run into if the native code version is run for long enough?  Is there any way I can figure out what's causing this?  Is there a way to reset the toplevel without killing the process?

This is on Win98, OCaml 3.00, with a custom toplevel (built with unix, lablgl, and labltk).


fresh inferior-caml:
{Gc.minor_words=104712; Gc.promoted_words=41874; Gc.major_words=101633;
 Gc.minor_collections=5; Gc.major_collections=1; Gc.heap_words=126976;
 Gc.heap_chunks=2; Gc.live_words=101633; Gc.live_blocks=20071;
 Gc.free_words=25343; Gc.free_blocks=2; Gc.largest_free=25166;
 Gc.fragments=0; Gc.compactions=0}

after one run, things are nice and fast:
{Gc.minor_words=4963116; Gc.promoted_words=481604; Gc.major_words=681315;
 Gc.minor_collections=153; Gc.major_collections=3; Gc.heap_words=717824;
 Gc.heap_chunks=11; Gc.live_words=272130; Gc.live_blocks=77445;
 Gc.free_words=50961; Gc.free_blocks=222; Gc.largest_free=45281;
 Gc.fragments=54; Gc.compactions=0}

after ten or so runs, things are chugging at this point:
{Gc.minor_words=26965304; Gc.promoted_words=3293457; Gc.major_words=3519501;
 Gc.minor_collections=824; Gc.major_collections=8; Gc.heap_words=2241536;
 Gc.heap_chunks=35; Gc.live_words=201410; Gc.live_blocks=63981;
 Gc.free_words=222291; Gc.free_blocks=2316; Gc.largest_free=34683;
 Gc.fragments=1258; Gc.compactions=0}

To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr