We're updating the issue view to help you get more done. 

Prevent Byte Buddy's Advice helper to need reloading many resources from the ClassLoader

Description

The current Byte Buddy Enhancer code is using net.bytebuddy.asm.Advice in a loop, while this helper will trigger loading of the target class's bytecode from the classloader using gerResourceAsStream(String).

This is working correctly, yet it's not cached by common ClassLoader implementations, so this actually triggers allocation of large byte arrays to unzip the JAR files on classpath, to materialize the requested resource.

I had an excellent reduction in memory pressure of the whole Enhancement process by extracting the various Advice classes we need as fields oif the Enhancer.

Environment

None

Status

Assignee

Sanne Grinovero

Reporter

Sanne Grinovero

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Minor