This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 7c8b658 Use String Intern to reduce memory allocation (#7671)
7c8b658 is described below
commit 7c8b658e40b4d81ef00d6b7237330f9e4e00984a
Author: Albumen Kevin <[email protected]>
AuthorDate: Fri May 14 13:12:08 2021 +0800
Use String Intern to reduce memory allocation (#7671)
---
.../src/main/java/org/apache/dubbo/common/BaseServiceMetadata.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/dubbo-common/src/main/java/org/apache/dubbo/common/BaseServiceMetadata.java
b/dubbo-common/src/main/java/org/apache/dubbo/common/BaseServiceMetadata.java
index 27893cd..f8a6516 100644
---
a/dubbo-common/src/main/java/org/apache/dubbo/common/BaseServiceMetadata.java
+++
b/dubbo-common/src/main/java/org/apache/dubbo/common/BaseServiceMetadata.java
@@ -42,7 +42,7 @@ public class BaseServiceMetadata {
if (version != null && version.length() > 0) {
buf.append(":").append(version);
}
- return buf.toString();
+ return buf.toString().intern();
}
public static String versionFromServiceKey(String serviceKey) {