summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-04-14 20:23:09 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-04-14 20:23:09 +0000
commit33c1ef2100dbfc3a991e7975f6d07d88d72b285c (patch)
treef1dda44ffc28f83f1aa08f591fa7a02700b63566 /searchlib
parenta7be29795a9c8ebd21b0869b249361908297828d (diff)
Only the dead should be counted as dead.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumstore.hpp8
-rw-r--r--searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp4
2 files changed, 9 insertions, 3 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/enumstore.hpp b/searchlib/src/vespa/searchlib/attribute/enumstore.hpp
index c2740b6bd6b..0890605f265 100644
--- a/searchlib/src/vespa/searchlib/attribute/enumstore.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/enumstore.hpp
@@ -252,11 +252,15 @@ EnumStoreT<EntryT>::consider_compact_dictionary(const CompactionStrategy& compac
if (_dict->has_held_buffers()) {
return false;
}
- if (compaction_strategy.should_compact_memory(_cached_dictionary_btree_usage.usedBytes(), _cached_dictionary_btree_usage.usedBytes())) {
+ if (compaction_strategy.should_compact_memory(_cached_dictionary_btree_usage.usedBytes(),
+ _cached_dictionary_btree_usage.deadBytes()))
+ {
_dict->compact_worst(true, false);
return true;
}
- if (compaction_strategy.should_compact_memory(_cached_dictionary_hash_usage.usedBytes(), _cached_dictionary_hash_usage.usedBytes())) {
+ if (compaction_strategy.should_compact_memory(_cached_dictionary_hash_usage.usedBytes(),
+ _cached_dictionary_hash_usage.deadBytes()))
+ {
_dict->compact_worst(false, true);
return true;
}
diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
index 29c55c99363..8261f483e55 100644
--- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
@@ -318,7 +318,9 @@ ReferenceAttribute::consider_compact_dictionary(const CompactionStrategy &compac
if (dictionary.has_held_buffers()) {
return false;
}
- if (compaction_strategy.should_compact_memory(_cached_unique_store_dictionary_memory_usage.usedBytes(), _cached_unique_store_dictionary_memory_usage.usedBytes())) {
+ if (compaction_strategy.should_compact_memory(_cached_unique_store_dictionary_memory_usage.usedBytes(),
+ _cached_unique_store_dictionary_memory_usage.deadBytes()))
+ {
dictionary.compact_worst(true, true);
return true;
}