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

PermGen memory leak in script) #335

geb-bot opened this issue Sep 20, 2014 · 1 comment

PermGen memory leak in script) #335

geb-bot opened this issue Sep 20, 2014 · 1 comment


Copy link

geb-bot commented Sep 20, 2014

Originally created by Terence Kent.

Each call to Browser.driver(Closure script) leaks a small amount of PermGen memory. The leak appears to be caused by creating a new geb.Configuration object every time.

Steps to reproduce:

  1. Create a standard GebConfig.groovy file in the expected place
  2. Run the following code: while(true){ {} }
  3. Attached a debugger and watch the PermGen usage

(I've also attached a tiny program to demonstrate the issue)

The work around is to not use script) and instead use one of the other other methods that result in a cached Configuration object being used.

This bug will prevent long-running applications from relying on Geb for regular tasks, without discovering/working around this issue. This is more difficult than it sounds since the Book of Geb almost exclusively uses examples with script) and you won't discover the issue after the program has been running for some time.

Possible Solutions:

  1. Cache the configuration, the same way the webdriver is cached. If a concern shows up about supporting changing configs, make the old behavior possible through a system property.
  2. Adjust how the configuration works so the configuration classes created by GebConfig.groovy (or other config file) can be garbage collected. I have to assume this is possible, though I'm still new to groovy.
Copy link

geb-bot commented Sep 23, 2014


@geb-bot geb-bot added the Bug label Apr 12, 2015
@geb-bot geb-bot added this to the 0.10.0 milestone Apr 12, 2015
@geb-bot geb-bot closed this as completed Apr 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants