Fix byte array memory leak from MemoryBasedClassLoader
40 Mb of bytes of preloaded compiler classes during the compilation become 16 Mb after this change
This commit is contained in:
@@ -135,7 +135,11 @@ public class PathUtil {
|
||||
|
||||
@NotNull
|
||||
public static File getResourcePathForClass(@NotNull Class aClass) {
|
||||
String resourceRoot = PathManager.getResourceRoot(aClass, "/" + aClass.getName().replace('.', '/') + ".class");
|
||||
String path = "/" + aClass.getName().replace('.', '/') + ".class";
|
||||
String resourceRoot = PathManager.getResourceRoot(aClass, path);
|
||||
if (resourceRoot == null) {
|
||||
throw new IllegalStateException("Resource not found: " + path);
|
||||
}
|
||||
return new File(resourceRoot).getAbsoluteFile();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user