mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-27 02:30:06 +00:00
8237201: ZGC: Remove unused ZRelocationSetSelector::fragmentation()
Reviewed-by: tschatzl
This commit is contained in:
parent
d98a39a0e7
commit
72609092fe
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -40,8 +40,7 @@ ZRelocationSetSelectorGroup::ZRelocationSetSelectorGroup(const char* name,
|
||||
_registered_pages(),
|
||||
_sorted_pages(NULL),
|
||||
_nselected(0),
|
||||
_relocating(0),
|
||||
_fragmentation(0) {}
|
||||
_relocating(0) {}
|
||||
|
||||
ZRelocationSetSelectorGroup::~ZRelocationSetSelectorGroup() {
|
||||
FREE_C_HEAP_ARRAY(ZPage*, _sorted_pages);
|
||||
@ -50,8 +49,6 @@ ZRelocationSetSelectorGroup::~ZRelocationSetSelectorGroup() {
|
||||
void ZRelocationSetSelectorGroup::register_live_page(ZPage* page, size_t garbage) {
|
||||
if (garbage > _fragmentation_limit) {
|
||||
_registered_pages.add(page);
|
||||
} else {
|
||||
_fragmentation += garbage;
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,13 +140,7 @@ void ZRelocationSetSelectorGroup::select() {
|
||||
|
||||
// Finalize selection
|
||||
_nselected = selected_from;
|
||||
|
||||
// Update statistics
|
||||
_relocating = selected_from_size;
|
||||
for (size_t i = _nselected; i < npages; i++) {
|
||||
ZPage* const page = _sorted_pages[i];
|
||||
_fragmentation += page->size() - page->live_bytes();
|
||||
}
|
||||
|
||||
log_debug(gc, reloc)("Relocation Set (%s Pages): " SIZE_FORMAT "->" SIZE_FORMAT ", " SIZE_FORMAT " skipped",
|
||||
_name, selected_from, selected_to, npages - _nselected);
|
||||
@ -167,16 +158,11 @@ size_t ZRelocationSetSelectorGroup::relocating() const {
|
||||
return _relocating;
|
||||
}
|
||||
|
||||
size_t ZRelocationSetSelectorGroup::fragmentation() const {
|
||||
return _fragmentation;
|
||||
}
|
||||
|
||||
ZRelocationSetSelector::ZRelocationSetSelector() :
|
||||
_small("Small", ZPageSizeSmall, ZObjectSizeLimitSmall),
|
||||
_medium("Medium", ZPageSizeMedium, ZObjectSizeLimitMedium),
|
||||
_live(0),
|
||||
_garbage(0),
|
||||
_fragmentation(0) {}
|
||||
_garbage(0) {}
|
||||
|
||||
void ZRelocationSetSelector::register_live_page(ZPage* page) {
|
||||
const uint8_t type = page->type();
|
||||
@ -187,8 +173,6 @@ void ZRelocationSetSelector::register_live_page(ZPage* page) {
|
||||
_small.register_live_page(page, garbage);
|
||||
} else if (type == ZPageTypeMedium) {
|
||||
_medium.register_live_page(page, garbage);
|
||||
} else {
|
||||
_fragmentation += garbage;
|
||||
}
|
||||
|
||||
_live += live;
|
||||
@ -226,7 +210,3 @@ size_t ZRelocationSetSelector::garbage() const {
|
||||
size_t ZRelocationSetSelector::relocating() const {
|
||||
return _small.relocating() + _medium.relocating();
|
||||
}
|
||||
|
||||
size_t ZRelocationSetSelector::fragmentation() const {
|
||||
return _fragmentation + _small.fragmentation() + _medium.fragmentation();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -41,7 +41,6 @@ private:
|
||||
ZPage** _sorted_pages;
|
||||
size_t _nselected;
|
||||
size_t _relocating;
|
||||
size_t _fragmentation;
|
||||
|
||||
void semi_sort();
|
||||
|
||||
@ -57,7 +56,6 @@ public:
|
||||
ZPage* const* selected() const;
|
||||
size_t nselected() const;
|
||||
size_t relocating() const;
|
||||
size_t fragmentation() const;
|
||||
};
|
||||
|
||||
class ZRelocationSetSelector : public StackObj {
|
||||
@ -66,7 +64,6 @@ private:
|
||||
ZRelocationSetSelectorGroup _medium;
|
||||
size_t _live;
|
||||
size_t _garbage;
|
||||
size_t _fragmentation;
|
||||
|
||||
public:
|
||||
ZRelocationSetSelector();
|
||||
@ -78,7 +75,6 @@ public:
|
||||
size_t live() const;
|
||||
size_t garbage() const;
|
||||
size_t relocating() const;
|
||||
size_t fragmentation() const;
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_Z_ZRELOCATIONSETSELECTOR_HPP
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user