ehcache / sizeof

Configurable sizeOf engine for Ehcache
Apache License 2.0
105 stars 43 forks source link

Use gmavenplus-plugin? #44

Closed puntogil closed 7 years ago

puntogil commented 8 years ago

Hi seem gmaven is dead (latest release published 20 Sep 2013 ) can you replace with org.codehaus.gmavenplus:gmavenplus-plugin:1.5 ( published 9 Mar 2015 )? i added this code to the pom file, and seem work

<executions>
  <execution>
    <id>create-agent-jar</id>
    <phase>process-classes</phase>
    <goals>
      <goal>execute</goal>
    </goals>
  </execution>
</executions>
<configuration>
  <scripts>
    <script><![CDATA[
      def jarFile = new File(project.build.directory, "/classes/org/ehcache/sizeof/impl/sizeof-agent.jar");
      def agentClass = "/org/ehcache/sizeof/impl/SizeOfAgent.class"
      def agentDir = project.build.directory + "/agent-jar"
      def manifestDir = project.basedir.getAbsolutePath() + "/src/hidden/resources";
      ant.move(file: new File(project.build.outputDirectory, agentClass),
      tofile: new File(agentDir, agentClass))

      ant.jar(destfile: jarFile, basedir: new File(agentDir).getAbsolutePath(), manifest: new File(manifestDir, "/META-INF/MANIFEST.MF"))

      ant.delete(dir: new File(agentDir))
    ]]></script>
  </scripts>
</configuration>
<dependencies>
  <dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.4.4</version>
    <scope>runtime</scope>
  </dependency>
</dependencies>

Thanks in advance for every suggestions Regards

puntogil commented 8 years ago

This test fails

Running org.ehcache.sizeof.SizeOfTest
Could not detect compressed-oops status assuming: false
May 02, 2016 9:02:35 PM org.ehcache.sizeof.impl.JvmInformation <clinit>
INFO: Detected JVM data model settings of: 32-Bit OpenJDK JVM
java.vm.name:   OpenJDK Server VM
java.vm.vendor: Oracle Corporation
May 02, 2016 9:02:35 PM org.ehcache.sizeof.impl.AgentLoader$1 run
INFO: Located valid 'tools.jar' at '/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-2.b14.fc23.i386/jre/../lib/tools.jar'
May 02, 2016 9:02:35 PM org.ehcache.sizeof.impl.AgentLoader loadAgent
INFO: Trying to load agent @ /home/gil/rpmbuild/BUILD/sizeof-0.3.0/target/classes/org/ehcache/sizeof/impl/sizeof-agent.jar
May 02, 2016 9:02:35 PM org.ehcache.sizeof.impl.AgentLoader loadAgent
INFO: Agent successfully loaded and available!
JVM identified as: OPENJDK_32_BIT
Run # 1: Deviation of -0.429%
5784808 bytes are actually being used, while we believe 5760000 are
Run # 2: Deviation of -0.000%
5760000 bytes are actually being used, while we believe 5760000 are
Run # 3: Deviation of -0.000%
5760000 bytes are actually being used, while we believe 5760000 are
Two perfect matches, that's good enough... bye y'all!
Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.257 sec <<< FAILURE! - in org.ehcache.sizeof.SizeOfTest
testSizeOf(org.ehcache.sizeof.SizeOfTest)  Time elapsed: 0.041 sec  <<< FAILURE!
java.lang.AssertionError: 
java.lang.AssertionError: deepSizeOf(new ReentrantReadWriteLock())
Expected: is null
     but: was <112L>

        at org.ehcache.sizeof.SizeOfTest.testSizeOf(SizeOfTest.java:113)
lorban commented 8 years ago

Regarding the test failures, they simply haven't been adapted to run on any JDK version above 1.7. I've opened #45 to add support for more recent JDKs.

Regarding the gmaven plugin, since what we use it for is pretty limited and simple I'm not sure it's worth upgrading. But we'll consider that for the next release.

Thanks!