On Tue, 2008-01-15 at 14:59 +0100, pancake wrote:
> I plan to write a daemon in Vala. My reasons are:
> 
>  - clean code
>  - low footprint
>  - direct C bindings
> 
> The problem is that this program will run indefinitely on an ARM board out of 
> the human
> acces for a long while (together with others mobos that will be doing the 
> same).
> 
> My question is..does anyone has checked if Vala leaks?

I've run valac under valgrind a couple of times and fixed issues that
appeared. I don't know of any memory leak issues in the memory manager
of the Vala compiler. However, the generated bindings miss a lot of
memory management-related metadata and this may lead to quite some
memory leaks in applications using them.

The long-term plan is to add necessary annotations to the source code
comments of all GNOME libraries (as part of gobject-introspection work).
The bindings generator will interpret these annotations and generate
correct VAPI files.

The short-term plan is to add appropriate attributes to the .metadata
files of generated bindings but this is a tedious task.

> I think that the main reason if a vala program leaks is the program itself, 
> coz is
> not properly written.

Leaks (resp. use after free) should only be possible when using broken
bindings, circular references, or raw pointers (and so avoiding the
automatic memory management).

> BTW i think that GLIB has some memory-usage statistics and backtracing and so,
> is this accesible from Vala? (if accesible from c it is :P but no idea how)

Try valgrind, you can use it with Vala applications exactly the same.

http://live.gnome.org/Valgrind

Jürg

_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to