add peak memory use to vector-set-performance-stats!

This commit is contained in:
Matthew Flatt 2015-01-22 10:09:39 -07:00
parent 9f59d57ee4
commit 7196dc0e74
3 changed files with 14 additions and 6 deletions

View File

@ -312,7 +312,9 @@ any custodians.
When Racket is compiled without support for memory accounting, the When Racket is compiled without support for memory accounting, the
estimate is the same (i.e., all memory) for any individual custodian; estimate is the same (i.e., all memory) for any individual custodian;
see also @racket[custodian-memory-accounting-available?].} see also @racket[custodian-memory-accounting-available?].
See also @racket[vector-set-performance-stats!].}
@defproc[(dump-memory-stats [v any/c] ...) any]{ @defproc[(dump-memory-stats [v any/c] ...) any]{

View File

@ -158,11 +158,11 @@ otherwise platform-independent.}
Sets elements in @racket[results] to report current performance Sets elements in @racket[results] to report current performance
statistics. If @racket[thd] is not @racket[#f], a particular set of statistics. If @racket[thd] is not @racket[#f], a particular set of
thread-specific statistics are reported, otherwise a different set of thread-specific statistics are reported, otherwise a different set of
global statics are reported. global (within the current @tech{place}) statics are reported.
For global statistics, up to @math{11} elements are set in the vector, For global statistics, up to @math{12} elements are set in the vector,
starting from the beginning. If @racket[results] has @math{n} elements starting from the beginning. If @racket[results] has @math{n} elements
where @math{n < 11}, then the @math{n} elements are set to the first where @math{n < 12}, then the @math{n} elements are set to the first
@math{n} performance-statistics values. The reported statistics values @math{n} performance-statistics values. The reported statistics values
are as follows, in the order that they are set within are as follows, in the order that they are set within
@racket[results]: @racket[results]:
@ -179,7 +179,7 @@ are as follows, in the order that they are set within
by @racket[current-gc-milliseconds].} by @racket[current-gc-milliseconds].}
@item{@racket[3]: The number of garbage collections performed since @item{@racket[3]: The number of garbage collections performed since
start-up.} start-up within the current @tech{place}.}
@item{@racket[4]: The number of thread context switches performed since @item{@racket[4]: The number of thread context switches performed since
start-up.} start-up.}
@ -206,6 +206,9 @@ are as follows, in the order that they are set within
@item{@racket[10]: The number of bytes allocated for machine code @item{@racket[10]: The number of bytes allocated for machine code
that is not reported by @racket[current-memory-use].} that is not reported by @racket[current-memory-use].}
@item{@racket[11]: The peak number of allocated bytes just
before a garbage collection.}
] ]
For thread-specific statistics, up to @math{4} elements are set in the For thread-specific statistics, up to @math{4} elements are set in the
@ -227,4 +230,5 @@ vector:
thread's continuation.} thread's continuation.}
] ]
}
@history[#:changed "6.1.1.8" @elem{Added vector position @racket[11] for global statistics.}]}

View File

@ -9320,6 +9320,8 @@ static Scheme_Object *current_stats(int argc, Scheme_Object *argv[])
switch (SCHEME_VEC_SIZE(v)) { switch (SCHEME_VEC_SIZE(v)) {
default: default:
case 12:
set_perf_vector(v, ov, 11, scheme_make_integer(max_gc_pre_used_bytes));
case 11: case 11:
set_perf_vector(v, ov, 10, scheme_make_integer(scheme_jit_malloced)); set_perf_vector(v, ov, 10, scheme_make_integer(scheme_jit_malloced));
case 10: case 10: