Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable class info for resource only scan. #393

Merged
merged 1 commit into from May 28, 2019

Conversation

johnou
Copy link

@johnou johnou commented May 28, 2019

Our new auto-balancing actor system caused Orbit to invoke cloud.orbit.actors.runtime.DefaultClassDictionary#ensureLoaded which causes services configured with a small heap to OOM.

@JoeHegarty JoeHegarty merged commit 8e2dab1 into orbit:master May 28, 2019
@johnou johnou deleted the lower_footprint branch May 28, 2019 17:43
@lukehutch
Copy link

See discussion I just posted to

https://gitter.im/classgraph/Lobby

However in summary, this should probably be:

            try (ScanResult scanResult = new ClassGraph()
                    .whitelistPathsNonRecursive(META_INF_SERVICES_ORBIT_CLASSES)
                    .scan())
            {
                scanResult.getResourcesWithExtension(EXTENSION)
                        .forEachInputStream((Resource resource, InputStream stream) -> {
                            loadClassInfo(resource.getPath(), stream);
                        });
            }

or use .whitelistPaths() rather than .whitelistPathsNonRecursive(), if the resource can be in a subdirectory of META_INF_SERVICES_ORBIT_CLASSES.

@johnou
Copy link
Author

johnou commented Jun 28, 2019

thanks @lukehutch I updated to use whitelistPaths as there are sub folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants