Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-10133

ReflectionSingleObjectSizer throws when sizing hidden classes

    XMLWordPrintableJSON

Details

    Description

      On JDK 17, the class of a lambda is a "hidden" class. When ReflectionSingleObjectSizer tries to find the offset of the fields of a hidden class, the JDK throws UnsupportedOperationException.

      Tests that fail due to this exception:

      • MemoryOverheadIntegrationTest
      • OutOfMemoryDUnitTest
      • SessionReplicationLocalCacheJUnitTest

      Example exception from MemoryOverheadIntegrationTest:

      ava.lang.UnsupportedOperationException: can't get field offset on a hidden class: private final org.apache.geode.internal.cache.InternalCache org.apache.geode.redis.internal.GeodeRedisServer$$Lambda$607/0x00000008011434d8.arg$1
      at sun.misc.Unsafe.objectFieldOffset(Unsafe.java:645)
      at org.apache.geode.unsafe.internal.sun.misc.Unsafe.fieldOffset(Unsafe.java:187)
      at org.apache.geode.internal.size.ReflectionSingleObjectSizer.sizeof(ReflectionSingleObjectSizer.java:106)
      at org.apache.geode.internal.size.ReflectionSingleObjectSizer.sizeof(ReflectionSingleObjectSizer.java:84)
      at org.apache.geode.internal.size.ReflectionSingleObjectSizer.sizeof(ReflectionSingleObjectSizer.java:52)
      at org.apache.geode.internal.size.CachingSingleObjectSizer.sizeof(CachingSingleObjectSizer.java:39)
      at org.apache.geode.internal.size.ObjectGraphSizer$SizeVisitor.visit(ObjectGraphSizer.java:223)
      at org.apache.geode.internal.size.ObjectTraverser$VisitStack.add(ObjectTraverser.java:163)
      at org.apache.geode.internal.size.ObjectTraverser.doSearch(ObjectTraverser.java:87)
      at org.apache.geode.internal.size.ObjectTraverser.breadthFirstSearch(ObjectTraverser.java:54)
      at org.apache.geode.internal.size.ObjectGraphSizer.size(ObjectGraphSizer.java:96)
      at org.apache.geode.redis.internal.data.MemoryOverheadIntegrationTest.getUsedMemory(MemoryOverheadIntegrationTest.java:95)
      at org.apache.geode.redis.internal.data.AbstractMemoryOverheadIntegrationTest.measureAndCheckPerEntryOverhead(AbstractMemoryOverheadIntegrationTest.java:284)
      at org.apache.geode.redis.internal.data.AbstractMemoryOverheadIntegrationTest.measureOverheadPerHash(AbstractMemoryOverheadIntegrationTest.java:127)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:568)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      at org.apache.geode.test.junit.rules.serializable.SerializableExternalResource$1.evaluate(SerializableExternalResource.java:38)
      at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
      at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
      at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
      at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
      at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
      at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
      at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72)
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
      at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
      at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
      at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
      at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:568)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
      at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
      at jdk.proxy1.$Proxy2.stop(Unknown Source)
      at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:568)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
      at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
      at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
      at java.lang.Thread.run(Thread.java:833)
      

      Attachments

        Issue Links

          Activity

            People

              dschneider Darrel Schneider
              demery Dale Emery
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: