ClassGraph v4.8.63 Release Notes

Release Date: 2020-02-16 // about 4 years ago
  • NOTE: Please use 4.8.64 instead of 4.8.63, as 4.8.64 contains a fix to a regression for JDK 7/8 compatibility.

    ๐ŸŽ Dramatically lowered the memory requirements of ClassGraph, and optimized file reading performance (#400 -- thanks to @TWiStErRob for the extremely detailed and well-researched error report and unit test!).

    • The file access backend (which virtualizes access to file content across jarfiles, nested jarfiles, remote jarfiles, directories on disk, and modules) was rewritten to be faster and to have lower memory requirements. This was a large change -- please report any issues you come across.
    • 0๏ธโƒฃ Mmap is now disabled by default (the new file reading backend uses FileChannel rather than MappedByteBuffer to read file content by default). Disabling mmap gives much more consistent scan times than in previous versions of ClassGraph, and causes significantly lower pressure on the memory limit when there are a large number of jarfiles (#400).

    ๐ŸŽ There may be a small performance penalty to disabling mmap by default. You can re-enable it by calling ClassGraph#enableMemoryMapping() before calling scan(). This will probably only make a difference with large classpaths consisting of many large jarfiles.

    ๐Ÿ›  Also fixed numerous bugs, including:

    • ๐Ÿ›  Fixed an infinite loop that could be triggered by OutOfMemoryError (which could be triggered by mmap'ing too many files) (#400)
    • 0๏ธโƒฃ When a nested deflated jarfile is extracted to an array in memory so that its central directory can be read, the array containing the inflated jarfile is now trimmed to save on RAM. Previously, the full buffer default size of 64MB was retained for each jarfile, which wasted a lot of RAM. (This only affected scanning of projects with lots of nested jars, e.g. Spring-Boot jars, and only when the nested jars were deflated, not stored.) (#400)
    • ๐Ÿ›  Fixed a few Windows compatibility issues, including an issue with encoding the : character after a drive letter using %3A in URIs, e.g. file:/C%3A/Users/Luke/Project (now instead, the proper URI of file:/C:/Users/Luke/Project is returned by Resource#getURI()).
    • ๐Ÿ›  Fixed an issue where the default classpath was being scanned even if classloaders were overridden.