Skip to content

excessive loading of same InterfaceImpl #5023

@MartinNowak

Description

@MartinNowak

Environment

Provide at least:

  • jruby 9.1.15.0 (2.3.3) 2017-12-07 929fde8 Java HotSpot(TM) 64-Bit Server VM 25.144-b01 on 1.8.0_144-b01 +jit [linux-x86_64]
    jruby -J-Xms1g -J-Xmx1g -J-XX:+UseG1GC -J-XX:MetaspaceSize=192M -Xcompile.invokedynamic=true
  • Linux 4.4.0-109-generic Corrected a few typos #132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Other relevant info you may wish to add:

  • jbundler, pry, and rake
  • vert.x-3.5.0, cassandra-driver, kafka, and rxjava (all java libs)

Expected Behavior

  • Identical interface implementations should be cached.

Attached a verbose class loading log, digged into this when seeing 2+M loaded classes in JConsole, most being collected again, ~50K classes remain resident.

Jan 31 11:49:32 bundle[18113]: [Loaded org.jruby.gen.InterfaceImpl702540685 from __JVM_DefineClass__]
Jan 31 11:49:32 bundle[18113]: [Loaded org.jruby.gen.InterfaceImpl702540685 from __JVM_DefineClass__]
Jan 31 11:49:32 bundle[18113]: [Loaded org.jruby.gen.InterfaceImpl702540685 from __JVM_DefineClass__]

iface_impl.log

With -Xinterfaces.useProxy=true I'm only seeing ~13K resident classes and ~750MiB less memory being used (guess that's Metaspace), so that seems like a viable workaround for now.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions