Skip to content

Commit

Permalink
Revert "metaspace内存持续上涨 (#3299)"
Browse files Browse the repository at this point in the history
This reverts commit a15a7fc.
  • Loading branch information
wenshao committed Jan 22, 2025
1 parent 831bb91 commit 402d21d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,6 @@ private ObjectWriter getObjectWriterInternal(Type objectType, Class objectClass,
if (objectWriter != null) {
return objectWriter;
}
} else {
objectWriter = cache.get(objectType);
if (objectWriter != null) {
return objectWriter;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
import com.alibaba.fastjson2.writer.ObjectWriter;
import com.alibaba.fastjson2.writer.ObjectWriterProvider;
import org.junit.jupiter.api.Test;
import org.springframework.cglib.proxy.Enhancer;
import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.concurrent.TimeUnit;

import static org.junit.jupiter.api.Assertions.*;

Expand Down Expand Up @@ -136,28 +131,9 @@ public void testWriter2() {
assertSame(writer1, JSON.registerIfAbsent(Bean.class, writer, false));
}

@Test
public void testWriterProxy() throws InterruptedException {
Enhancer enhancer = new Enhancer();
enhancer.setSuperclass(Bean.class);
enhancer.setCallback(new BeanMethodInterceptor());
Object proxy1 = enhancer.create();
JSON.toJSONString(proxy1);
JSON.toJSONString(proxy1);
TimeUnit.MINUTES.sleep(60);
}

public static class Bean {
}

public static class BeanMethodInterceptor implements MethodInterceptor {

@Override
public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
return methodProxy.invokeSuper(o, objects);
}
}

public static class BeanWriter
implements ObjectWriter {
@Override
Expand Down

0 comments on commit 402d21d

Please sign in to comment.