Question: I have a test suite of 50 tests and after running some 30 tests, my build fails by giving a java.lang.OutOfMemory : permgen space. I have searched online and tried to increase the permgen space, changed the JAVA\_OPTS, MAVEN\_OPTS also.But none of this seem to work.The tests still fail. Now either I have not set the space correctly or I am not approaching the problem in the right way. my application is using Grails with selenium webdriver 2.19. 

Please help.

Answer: 
Try to find and fix the class loader leak.

Find Informations here: <https://blogs.oracle.com/fkieviet/entry/classloader_leaks_the_dreaded_java>
How much memory did you specify? Probably that was not enough. Try to run $JAVA\_HOME/bin/jvisualvm after your application/test cases are started and to find out how much does it really need.