Skip to content

Admin Service creates a growing number of temporary files on Windows #332

@laserval

Description

@laserval

When scanning library JARs for stage classes, the Admin Service has to copy the JARs to disk in a temporary directory. A class loader is created for each stage, which scans for @Stage annotations.

The class loader used is URLClassLoader (see https://github.com/Findwise/Hydra/blob/master/admin-service/src/main/java/com/findwise/hydra/admin/StageScanner.java#L27), which will open file handles to all encountered JARs. Once the JARs are scanned, the Admin Service should clean up by removing all the JARs.

On Windows, the cleanup fails due to URLClassLoader keeping the files open (see this JVM bug: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=5041014). This means the number of temporary files, if not cleaned up, will continue to grow.

As noted in the JVM bug link above, the solution is to upgrade to Java 7 and use the new URLClassLoader.close() method.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions