You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/10/08 08:02:43 UTC
[doris] 02/03: [fix](string) allocate memory according to actual size instead of max size (#13112)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.1-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
commit ea7d9ec34f9ff611e0e0c0019bf7ac250316bbc6
Author: Yongqiang YANG <98...@users.noreply.github.com>
AuthorDate: Thu Oct 6 09:56:22 2022 +0800
[fix](string) allocate memory according to actual size instead of max size (#13112)
String column lengh is 2GB, if we allocate memory according to column length,
string would consume a lot of memory. It also misleads memory tracker.
---
be/src/olap/wrapper_field.cpp | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/be/src/olap/wrapper_field.cpp b/be/src/olap/wrapper_field.cpp
index 887b93b259..ffb4516193 100644
--- a/be/src/olap/wrapper_field.cpp
+++ b/be/src/olap/wrapper_field.cpp
@@ -52,11 +52,7 @@ WrapperField* WrapperField::create(const TabletColumn& column, uint32_t len) {
variable_len =
std::max(len, static_cast<uint32_t>(column.length() - sizeof(VarcharLengthType)));
} else if (column.type() == OLAP_FIELD_TYPE_STRING) {
- // column.length is the serialized varchar length
- // the first sizeof(StringLengthType) bytes is the length of varchar
- // variable_len is the real length of varchar
- variable_len =
- std::max(len, static_cast<uint32_t>(column.length() - sizeof(StringLengthType)));
+ variable_len = len;
} else {
variable_len = column.length();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org