Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
953434c2
R
runtime
项目概览
dotNET Platform
/
runtime
12 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
953434c2
编写于
8月 07, 2023
作者:
M
Maoni Stephens
提交者:
GitHub
8月 07, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make sure to only enable things meant for DATAS when it's on (#90008)
also reverted a couple of things that were supposed to be temporary
上级
03fbaad4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
28 deletion
+44
-28
src/coreclr/gc/gc.cpp
src/coreclr/gc/gc.cpp
+32
-28
src/coreclr/gc/gcpriv.h
src/coreclr/gc/gcpriv.h
+12
-0
未找到文件。
src/coreclr/gc/gc.cpp
浏览文件 @
953434c2
...
...
@@ -2917,6 +2917,7 @@ BOOL gc_heap::should_expand_in_full_gc = FALSE;
#endif //!USE_REGIONS
#ifdef DYNAMIC_HEAP_COUNT
int gc_heap::dynamic_adaptation_mode = dynamic_adaptation_default;
gc_heap::dynamic_heap_count_data_t SVR::gc_heap::dynamic_heap_count_data;
#endif // DYNAMIC_HEAP_COUNT
...
...
@@ -14032,6 +14033,26 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size,
HRESULT hres = S_OK;
conserve_mem_setting = (int)GCConfig::GetGCConserveMem();
#ifdef DYNAMIC_HEAP_COUNT
dynamic_adaptation_mode = (int)GCConfig::GetGCDynamicAdaptationMode();
if (GCConfig::GetHeapCount() != 0)
{
dynamic_adaptation_mode = 0;
}
if ((dynamic_adaptation_mode == dynamic_adaptation_to_application_sizes) && (conserve_mem_setting == 0))
conserve_mem_setting = 5;
#endif //DYNAMIC_HEAP_COUNT
if (conserve_mem_setting < 0)
conserve_mem_setting = 0;
if (conserve_mem_setting > 9)
conserve_mem_setting = 9;
dprintf (1, ("conserve_mem_setting = %d", conserve_mem_setting));
#ifdef WRITE_WATCH
hardware_write_watch_api_supported();
#ifdef BACKGROUND_GC
...
...
@@ -14271,7 +14292,7 @@ gc_heap::init_semi_shared()
#ifdef MULTIPLE_HEAPS
mark_list_size = min (100*1024, max (8192, soh_segment_size/(2*10*32)));
#ifdef DYNAMIC_HEAP_COUNT
if (
GCConfig::GetGCDynamicAdaptationMode() == 1 && GCConfig::GetHeapCount() == 0
)
if (
dynamic_adaptation_mode == dynamic_adaptation_to_application_sizes
)
{
// we'll actually start with one heap in this case
g_mark_list_total_size = mark_list_size;
...
...
@@ -14480,16 +14501,6 @@ gc_heap::init_semi_shared()
#endif //FEATURE_LOH_COMPACTION
#endif //FEATURE_EVENT_TRACE
conserve_mem_setting = (int)GCConfig::GetGCConserveMem();
if (conserve_mem_setting == 0 && GCConfig::GetGCDynamicAdaptationMode() == 1)
conserve_mem_setting = 5;
if (conserve_mem_setting < 0)
conserve_mem_setting = 0;
if (conserve_mem_setting > 9)
conserve_mem_setting = 9;
dprintf (1, ("conserve_mem_setting = %d", conserve_mem_setting));
reset_mm_p = TRUE;
ret = 1;
...
...
@@ -21229,7 +21240,7 @@ int gc_heap::generation_to_condemn (int n_initial,
int n_alloc = n;
if (heap_number == 0)
{
dprintf (
5555
, ("init: %d(%d)", n_initial, settings.reason));
dprintf (
GTC_LOG
, ("init: %d(%d)", n_initial, settings.reason));
}
int i = 0;
int temp_gen = 0;
...
...
@@ -22570,10 +22581,6 @@ void gc_heap::gc1()
gc_t_join.restart();
}
#ifdef USE_REGIONS
// rethread_fl_items ();
#endif //USE_REGIONS
update_end_gc_time_per_heap();
add_to_history_per_heap();
alloc_context_count = 0;
...
...
@@ -25033,15 +25040,8 @@ void gc_heap::check_heap_count ()
{
dynamic_heap_count_data.new_n_heaps = n_heaps;
if (GCConfig::GetHeapCount() != 0)
{
// don't change the heap count if we see an environment variable setting it explicitly
return;
}
if (GCConfig::GetGCDynamicAdaptationMode() == 0)
if (dynamic_adaptation_mode != dynamic_adaptation_to_application_sizes)
{
// don't change the heap count dynamically if the feature isn't explicitly enabled
return;
}
...
...
@@ -43053,7 +43053,8 @@ size_t gc_heap::desired_new_allocation (dynamic_data* dd,
max (min_gc_size, (max_size/3)));
}
if (conserve_mem_setting != 0)
#ifdef DYNAMIC_HEAP_COUNT
if (dynamic_adaptation_mode == dynamic_adaptation_to_application_sizes)
{
// if this is set, limit gen 0 size to a small multiple of the older generations
float f_older_gen = ((10.0f / conserve_mem_setting) - 1) * 0.5f;
...
...
@@ -43079,6 +43080,7 @@ size_t gc_heap::desired_new_allocation (dynamic_data* dd,
older_size,
new_allocation));
}
#endif //DYNAMIC_HEAP_COUNT
}
}
...
...
@@ -48281,9 +48283,9 @@ HRESULT GCHeap::Initialize()
{
#ifdef DYNAMIC_HEAP_COUNT
// if no heap count was specified, and we are told to adjust heap count dynamically ...
if (
GCConfig::GetHeapCount() == 0 && GCConfig::GetGCDynamicAdaptationMode() == 1
)
if (
gc_heap::dynamic_adaptation_mode == dynamic_adaptation_to_application_sizes
)
{
//
...
start with only 1 heap
// start with only 1 heap
gc_heap::smoothed_desired_total[0] /= gc_heap::n_heaps;
gc_heap::g_heaps[0]->change_heap_count (1);
}
...
...
@@ -50746,11 +50748,13 @@ size_t gc_heap::get_gen0_min_size()
int n_heaps = 1;
#endif //SERVER_GC
if (GCConfig::GetGCConserveMem() != 0 || GCConfig::GetGCDynamicAdaptationMode() == 1)
#ifdef DYNAMIC_HEAP_COUNT
if (dynamic_adaptation_mode == dynamic_adaptation_to_application_sizes)
{
// if we are asked to be stingy with memory, limit gen 0 size
gen0size = min (gen0size, (4*1024*1024));
}
#endif //DYNAMIC_HEAP_COUNT
dprintf (1, ("gen0size: %zd * %d = %zd, physical mem: %zd / 6 = %zd",
gen0size, n_heaps, (gen0size * n_heaps),
src/coreclr/gc/gcpriv.h
浏览文件 @
953434c2
...
...
@@ -617,6 +617,14 @@ enum gc_type
gc_type_max
=
3
};
#ifdef DYNAMIC_HEAP_COUNT
enum
gc_dynamic_adaptation_mode
{
dynamic_adaptation_default
=
0
,
dynamic_adaptation_to_application_sizes
=
1
,
};
#endif //DYNAMIC_HEAP_COUNT
//encapsulates the mechanism for the current gc
class
gc_mechanisms
{
...
...
@@ -4427,6 +4435,10 @@ private:
PER_HEAP_ISOLATED_FIELD_INIT_ONLY
size_t
youngest_gen_desired_th
;
#endif //HOST_64BIT
#ifdef DYNAMIC_HEAP_COUNT
PER_HEAP_ISOLATED_FIELD_INIT_ONLY
int
dynamic_adaptation_mode
;
#endif //DYNAMIC_HEAP_COUNT
/********************************************/
// PER_HEAP_ISOLATED_FIELD_DIAG_ONLY fields //
/********************************************/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录