You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by "chaokunyang (via GitHub)" <gi...@apache.org> on 2026/04/01 13:02:49 UTC

Re: [PR] fix(java): Correct the async meta-shared layer bootstrap in ObjectStreamSerializer [fory]

chaokunyang commented on code in PR #3514:
URL: https://github.com/apache/fory/pull/3514#discussion_r3021963500


##########
java/fory-core/src/main/java/org/apache/fory/builder/CodecUtils.java:
##########
@@ -40,6 +40,12 @@ public class CodecUtils {
   // Cache key includes configHash to distinguish between xlang and non-xlang modes
   private static final ConcurrentHashMap<Tuple3<String, Class<?>, Integer>, Class>
       graalvmSerializers = new ConcurrentHashMap<>();
+  // Generated layer serializers need the original layer metadata to bootstrap their delegate
+  // synchronously in the constructor.
+  // This is a process-lifetime cache keyed by generated serializer class, which mirrors the
+  // existing codegen cache behavior and is populated only on the regular JVM path.
+  private static final ConcurrentHashMap<Class<?>, MetaSharedLayerCodecContext>

Review Comment:
   This will make class unable to gc. In some hotload with classloader, the class leak may happen.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org