[Vala] memory detection



Is it possible to detect when a program is using, say, 90% of the memory that is available, so that I can take steps to reduce usage? I've got a method that would like to use probably more memory than is available, but which can (if it could tell) save stuff to files to free memory it isn't using at the moment. Garbage collection, isn't quite the same thing. I don't want the stuff to be garbage collected until after I've saved it's current state, but to know when to do that, I need to know how much memory is currently free.

I suppose that I could set an arbitrary limit on the number of various things I allow before compacting, but that's a bit ... arbitrary. And doesn't adapt to different machines without recompiling.

--
Charles Hixson




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