Is there a portable way to limit memory/cpu usage of a D application?

deadalnix deadalnix at gmail.com
Thu Nov 10 05:18:33 PST 2011


Le 09/11/2011 18:12, Dejan Lekic a écrit :
> I would be satisfied with something like POSIX.1-2001 setrlimit() . Sure
> nothing prevents me from using setrlimit() in my D app, but perhaps it is
> something to think about a portable way of doing that.
>
> One thing I like about my Java apps is that I can always specify (in the
> argument list) how much memory I want to allocate for them). Yes, it is a
> JVM specific thing, but perhaps a GC should have options to set at least the
> memory limit?
>
> Kind regards

Well no, but you can ask the gc to collect and realease block to the 
system explicitely (and not like in Java, which you can only trigger 
collection for young object from code). So basically you can control how 
much memory your application is consuming.


More information about the Digitalmars-d-learn mailing list