gpt4 book ai didi

prolog - SICStus Prolog 垃圾收集跟踪消息

转载 作者:行者123 更新时间:2023-12-04 09:42:38 24 4
gpt4 key购买 nike

浏览SICStus Prolog User's Manual我偶然发现了 Prolog 标志 gc_tracing .

我想知道更多,所以我开始在 "Book Index"并为 gc_trace 找到了 3 个条目:

G
gc_trace (prolog flag): ref-lps-flg (#1: "4.9.4 Prolog Flags")
gc_trace (prolog flag): ref-mgc-egc (#2: "4.10.3 Enabling and Disabling the Garbage Collector")
gc_trace (prolog flag): ref-mgc-mgc (#3: "4.10.4 Monitoring Garbage Collections")



当我点击链接时,我发现了以下内容:

4.9.4 Prolog Flags

gc_trace

Governs global stack garbage collection trace messages.

verbose   Turn on verbose tracing of garbage collection.
terse   Turn on terse tracing of garbage collection.
off   Turn off tracing of garbage collection (the default).

4.10.3 Enabling and Disabling the Garbage Collector

[...] To monitor garbage collections in verbose mode, set the gc_trace flag to verbose. [...]

4.10.4 Monitoring Garbage Collections

By default, the user is given no indication that the garbage collector is operating. If no program ever runs out of space and no program using a lot of global stack space requires an inordinate amount of processing time, then such information is unlikely to be needed.

However, if a program thought to be using much global stack space runs out of space or runs inordinately slowly, then the user may want to determine whether more or less frequent garbage collections are necessary. Information obtained from the garbage collector by turning on the gc_trace Prolog flag can be helpful in this determination.



在“离谱 - 简洁 - 冗长”的范围内,我会说:简洁!哈哈,只是认真的:)

最后,事不宜迟,这是我的实际问题:

Given the verbosity flags of the OCaml garbage collector, find suitable combinations corresponding to the SICStus Prolog GC verbosity levels "off", "terse", and "verbose".


From the OCaml User's Manual:

Module GC

mutable verbose : int;

This value controls the GC messages on standard error output. It is a sum of some of the following flags, to print messages on the corresponding events:

0x001 Start of major GC cycle.
0x002 Minor collection and major GC slice.
0x004 Growing and shrinking of the heap.
0x008 Resizing of stacks and memory manager tables.
0x010 Heap compaction.
0x020 Change of GC parameters.
0x040 Computation of major GC slice size.
0x080 Calling of finalisation functions.
0x100 Bytecode executable and shared library search at start-up.
0x200 Computation of compaction-triggering condition.
0x400 Output GC statistics at program exit. Default: 0.


end_of_file

最佳答案

terse value 只打印一个简短的指示,表明 GC 即将发生。 verbose value 打印有关 GC 的更多详细信息。详细信息未记录在案,可能会发生变化,即供人类消费。

SICStus GC 确实有一些类似于“次要”和“主要”集合的东西,但 verbose次要收集和完整收集的输出相同。

当内存区域改变大小时不是“垃圾收集”,因此,目前没有办法在发生这种情况时获得指示(除非事后通过调用 statistics )。

我不知道 OCaml 内存管理器,但我猜非 off value 主要对应于前两个(“主要 GC 周期的开始”和“次要收集和主要 GC 切片”。)OCaml 标志。

关于prolog - SICStus Prolog 垃圾收集跟踪消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62259954/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com