diff --git a/pkgs/racket-doc/scribblings/reference/memory.scrbl b/pkgs/racket-doc/scribblings/reference/memory.scrbl index 685883cd78..494c27dc3c 100644 --- a/pkgs/racket-doc/scribblings/reference/memory.scrbl +++ b/pkgs/racket-doc/scribblings/reference/memory.scrbl @@ -312,7 +312,9 @@ any custodians. When Racket is compiled without support for memory accounting, the 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]{ diff --git a/pkgs/racket-doc/scribblings/reference/runtime.scrbl b/pkgs/racket-doc/scribblings/reference/runtime.scrbl index 9a3e6372e6..80f441f91d 100644 --- a/pkgs/racket-doc/scribblings/reference/runtime.scrbl +++ b/pkgs/racket-doc/scribblings/reference/runtime.scrbl @@ -158,11 +158,11 @@ otherwise platform-independent.} Sets elements in @racket[results] to report current performance statistics. If @racket[thd] is not @racket[#f], a particular 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 -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 are as follows, in the order that they are set within @racket[results]: @@ -179,7 +179,7 @@ are as follows, in the order that they are set within by @racket[current-gc-milliseconds].} @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 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 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 @@ -227,4 +230,5 @@ vector: thread's continuation.} ] -} + +@history[#:changed "6.1.1.8" @elem{Added vector position @racket[11] for global statistics.}]} diff --git a/racket/src/racket/src/thread.c b/racket/src/racket/src/thread.c index 0d7502ead8..f0e82ce5d8 100644 --- a/racket/src/racket/src/thread.c +++ b/racket/src/racket/src/thread.c @@ -9320,6 +9320,8 @@ static Scheme_Object *current_stats(int argc, Scheme_Object *argv[]) switch (SCHEME_VEC_SIZE(v)) { default: + case 12: + set_perf_vector(v, ov, 11, scheme_make_integer(max_gc_pre_used_bytes)); case 11: set_perf_vector(v, ov, 10, scheme_make_integer(scheme_jit_malloced)); case 10: