[Openmcl-devel] checking process memory usage

Gary Byers gb at clozure.com
Tue Jul 9 14:00:42 PDT 2013

On 7/9/13 9:18 AM, Florian Dietz wrote:
> Is there a way to determine how much memory a single thread is using? 
> I realize that this may be weird, since threads share memory, but is 
> it possible to determine how much memory was allocated by a specific 
> thread? Is it possible to limit memory usage of a thread?
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
All memory allocation in CCL is per-thread; once allocated objects are 
stored somewhere, it's possible for them to be referenced by any thread 
and not really practical to determine what a given thread is "using".

TIME reports changes to the calling thread's cumulative memory 
allocation.  It'd be much harder and only occasionally useful to report 
memory allocated by all threads.  The current thread's cumulative memory 
allocation can be obtained via CCL::TOTAL-BYTES-ALLOCATED; the function 
CCL::REPORT-TIME tries to compensate for the fact that calling 
CCL::TOTAL-BYTES-ALLOCATED can itself allocate memory.

There is no mechanism to limit a thread's memory allocation.

More information about the Openmcl-devel mailing list