Bug#509803: Fails to properly free memory on exit
severity 509803 wishlist thanks Goswin Brederlow a écrit : Please forward this upstream so ocaml can be made to call the finalizers at exit. I won't forward this bug to upstream because I don't agree with what is asked. I don't think it's a bug, and I believe one shouldn't rely on finalizers to be called on exit. Have you / Do you plan to submit this upstream? If not, I'll tag this bug wontfix and close it (unless someone else wants to push this upstream). Cheers, -- Stéphane -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#509803: Fails to properly free memory on exit
* Goswin Brederlow: I assumed that when the program exits normaly that all memory will be freed, specifically that *_finalize(value) is called for all custom blocks in case they have to do some custom cleanup. Unfortunately that is not the case. Having this functionality could be useful in some cases (like embedded databases, where proper closing may avoid costly recovery on the next program invocation). In my case I want to make sure there are no pending IO operations left in the queue when the program exits, specially no write operations still waiting to complete, as otherwise there might be data lost. Other uses for this could be removal of temp files, logging out from network connections (ftp, databases, ...), freeing of IPC resources and many more. As a rule of thumb, you must not rely on finalization for externally visible resources. Finalization is inherently asynchronous, and you hardly ever want such external interaction at random points in time. In addition, it is hard to instruct the garbage collector to collect unused objects in time before external resources are exhosted (because the collector only knows about memory and not the scarcity of other resources). It's better to use with-macro-style wrappers for managing external state. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#509803: Fails to properly free memory on exit
On Fri, Dec 26, 2008 at 03:39:06PM +0100, Goswin Brederlow wrote: I wrote some bindings for libaio using custom blocks for the C structures I need to allocate for the internal state and buffer. I also wrote *_finalize(value) functions for them so they get properly cleaned up when no longer in use. I assumed that when the program exits normaly that all memory will be freed, specifically that *_finalize(value) is called for all custom blocks in case they have to do some custom cleanup. Unfortunately that is not the case. I think I've seen this problem before and solved it using something along these lines: at_exit Gc.compact ;; Rich. -- Richard Jones Red Hat -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#509803: Fails to properly free memory on exit
On Sat, Dec 27, 2008 at 10:13:33AM +0100, Stéphane Glondu wrote: Goswin Brederlow a écrit : Package: ocaml Version: 3.10.2-3 Severity: normal [...] Please forward this upstream so ocaml can be made to call the finalizers at exit. Why don't you submit this bug to upstream yourself? This is not such a nice answer, don't you think? :) The debate about where to submit this kind of bug report is a long standing one, but there is nothing wrong in having bugs in the Debian BTS which are just proxies for upstream bug reports. It might help other Debian users in discovering that this has already been reported. Cheers. -- Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7 z...@{upsilon.cc,pps.jussieu.fr,debian.org} -- http://upsilon.cc/zack/ Dietro un grande uomo c'è ..| . |. Et ne m'en veux pas si je te tutoie sempre uno zaino ...| ..: | Je dis tu à tous ceux que j'aime signature.asc Description: Digital signature
Bug#509803: Fails to properly free memory on exit
Stefano Zacchiroli a écrit : Please forward this upstream so ocaml can be made to call the finalizers at exit. Why don't you submit this bug to upstream yourself? This is not such a nice answer, don't you think? :) Sorry, I didn't mean to offend/criticize. But it seemed weird to me that the submitter was aware that the problem was upstream, and yet submitted a bugreport against the Debian package. I was really expecting an answer. Cheers, -- Stéphane -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#509803: Fails to properly free memory on exit
Goswin Brederlow a écrit : Package: ocaml Version: 3.10.2-3 Severity: normal [...] Please forward this upstream so ocaml can be made to call the finalizers at exit. Why don't you submit this bug to upstream yourself? Cheers, -- Stéphane Glondu -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#509803: Fails to properly free memory on exit
Package: ocaml Version: 3.10.2-3 Severity: normal Hi, I wrote some bindings for libaio using custom blocks for the C structures I need to allocate for the internal state and buffer. I also wrote *_finalize(value) functions for them so they get properly cleaned up when no longer in use. I assumed that when the program exits normaly that all memory will be freed, specifically that *_finalize(value) is called for all custom blocks in case they have to do some custom cleanup. Unfortunately that is not the case. In my case I want to make sure there are no pending IO operations left in the queue when the program exits, specially no write operations still waiting to complete, as otherwise there might be data lost. Other uses for this could be removal of temp files, logging out from network connections (ftp, databases, ...), freeing of IPC resources and many more. Without ocaml calling the finalizer at exit one has to manually track allocated custom blocks causing 16 bytes (prev/next pointer) overhead per block and implement ones own cleanup code by using atexit() in an initializer, which is rather ugly. Please forward this upstream so ocaml can be made to call the finalizers at exit. MfG Goswin -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable'), (200, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.26-xen-frosties-1 Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1) Shell: /bin/sh linked to /bin/bash Versions of packages ocaml depends on: ii libx11-dev2:1.1.5-2 X11 client-side library (developme ii ocaml-base3.10.2-3 Runtime system for OCaml bytecode ii ocaml-nox 3.10.2-3 ML language implementation with a ocaml recommends no packages. Versions of packages ocaml suggests: ii tcl8.4-dev8.4.19-2 Tcl (the Tool Command Language) v8 ii tk8.4-dev 8.4.19-2 Tk toolkit for Tcl and X11, v8.4 - -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org