[Openmcl-devel] checking process memory usage
gb at clozure.com
Tue Jul 9 21:00:42 UTC 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
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