------------------------------------------------------------ revno: 398 committer: Jean-Vincent Loddo <lo...@lipn.univ-paris13.fr> branch nick: ocamlbricks timestamp: Thu 2014-06-19 18:18:47 +0200 message: Fixed a possible very critical memory leak introduced in revno 388. The problem was occurring in a thread calling the function `Linux.process.stat' repetitively in a loop. Strangely, the source of the problem seems to be the standard function `Scanf.fscanf'. In a way that I don't understand, `fscanf' seems able to get the GC confused: unused `Linux.process.stat' structures are indeed not collected (even forcing a collection with Gc.full_major). The workaround adopted consists in replacing `Scanf.fscanf ch' by a `Scanf.sscanf line' where `line' is read from `ch' by `Pervasives.input_line'. Now `stat' structures seem to be correctly collected. modified: SHELL/linux.ml
-- lp:ocamlbricks https://code.launchpad.net/~marionnet-drivers/ocamlbricks/trunk Your team marionnet-dev is subscribed to branch lp:ocamlbricks. To unsubscribe from this branch go to https://code.launchpad.net/~marionnet-drivers/ocamlbricks/trunk/+edit-subscription _______________________________________________ Mailing list: https://launchpad.net/~marionnet-dev Post to : marionnet-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~marionnet-dev More help : https://help.launchpad.net/ListHelp