Skip to content

Commit b531ff8

Browse files
author
kezhu.wukz
committed
fix Memory waste of ServerDataBox
1 parent 236298b commit b531ff8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/common/model/src/main/java/com/alipay/sofa/registry/common/model/ServerDataBox.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
*/
1717
package com.alipay.sofa.registry.common.model;
1818

19-
import com.fasterxml.jackson.annotation.JsonIgnore;
20-
2119
import java.io.ByteArrayInputStream;
2220
import java.io.ByteArrayOutputStream;
2321
import java.io.IOException;
2422
import java.io.ObjectInputStream;
2523
import java.io.ObjectOutputStream;
2624
import java.io.Serializable;
2725

26+
import com.fasterxml.jackson.annotation.JsonIgnore;
27+
2828
/**
2929
*
3030
* @author zhuoyu.sjw
@@ -93,7 +93,7 @@ public Object getObject() {
9393
* @throws ClassNotFoundException the class not found exception
9494
*/
9595
public Object extract() throws IOException, ClassNotFoundException {
96-
if (isInBytes()) {
96+
if (object == null && isInBytes()) {
9797
ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
9898
if (serialization != SERIALIZED_BY_JAVA) {
9999
throw new IOException("Unsupported serialization type: " + serialization);

0 commit comments

Comments
 (0)