Results 1 to 7 of 7

Thread: Running Grails application.. java.lang.OutOfMemoryError: PermGen space

Hybrid View

  1. #1
    Join Date
    Apr 2011
    Posts
    11

    Default Running Grails application.. java.lang.OutOfMemoryError: PermGen space

    Dear all,

    I'm using SpringSource Tool Suite Version: 2.6.1.RELEASE Build Id: 201105041000 and have problems with Java OutOfMemory. (Grails Project Version 1.3.7)

    I follow the tutorial to increase the Java memory allocation without sucess:
    http://artur.ejsmont.org/blog/conten...sts-and-tomcat

    I change the workspace from a NFS place to a local disk directory, same problem.

    My machine have Ubuntu 10.04 LTS x86 4 Core with 4GB of ram.

    This problem starts when I add 70 new files to the directory src/java.

    PS: I don't have root access on machine.

    Should I test the last version of the STS?

    Best regards,

  2. #2
    Join Date
    Apr 2011
    Posts
    11

    Default Running Grails application.. java.lang.OutOfMemoryError: PermGen space

    !ENTRY com.springsource.sts.grails.core 4 0 2011-05-13 12:29:56.866
    !MESSAGE Internal Error
    !STACK 0
    java.io.FileNotFoundException: /home/rd/pedro.ambrosio/Documents/workspace-sts-2.6.0.RELEASE/ehealthcom/application.properties (Too many open files)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.jav a:137)
    at com.springsource.sts.grails.core.model.GrailsBuild SettingsHelper.getApplicationProperties(GrailsBuil dSettingsHelper.java:55)
    at com.springsource.sts.grails.core.model.GrailsVersi on.getGrailsVersion(GrailsVersion.java:163)
    at com.springsource.sts.grails.ui.internal.importfixe s.GrailsProjectVersionFixer$ProjectChangeHandler.f ix(GrailsProjectVersionFixer.java:256)
    at com.springsource.sts.grails.ui.internal.importfixe s.GrailsProjectVersionFixer$ProjectChangeHandler.d efaultGrailsVersionChanged(GrailsProjectVersionFix er.java:215)
    at com.springsource.sts.grails.ui.internal.importfixe s.GrailsProjectVersionFixer$ProjectChangeHandler.p rojectsChanged(GrailsProjectVersionFixer.java:247)
    at com.springsource.sts.grails.ui.internal.importfixe s.GrailsProjectVersionFixer$ProjectChangeHandler.a ccess$1(GrailsProjectVersionFixer.java:221)
    at com.springsource.sts.grails.ui.internal.importfixe s.GrailsProjectVersionFixer$1.resourceChanged(Grai lsProjectVersionFixer.java:90)
    at org.eclipse.core.internal.events.NotificationManag er$2.run(NotificationManager.java:291)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner .java:42)
    at org.eclipse.core.internal.events.NotificationManag er.notify(NotificationManager.java:285)
    at org.eclipse.core.internal.events.NotificationManag er.broadcastChanges(NotificationManager.java:149)
    at org.eclipse.core.internal.resources.Workspace.broa dcastPostChange(Workspace.java:327)
    at org.eclipse.core.internal.resources.Workspace.endO peration(Workspace.java:1181)
    at org.eclipse.core.internal.resources.Synchronizer.s etSyncInfo(Synchronizer.java:258)
    at org.tigris.subversion.subclipse.core.status.Synchr onizerSyncInfoCache$SyncInfoSynchronizedAccessor.i nternalSetCachedSyncBytes(SynchronizerSyncInfoCach e.java:236)
    at org.tigris.subversion.subclipse.core.status.Synchr onizerSyncInfoCache.setCachedSyncBytes(Synchronize rSyncInfoCache.java:156)
    at org.tigris.subversion.subclipse.core.status.Synchr onizerSyncInfoCache.addStatus(SynchronizerSyncInfo Cache.java:73)
    at org.tigris.subversion.subclipse.core.status.Status CacheManager.updateCache(StatusCacheManager.java:1 28)
    at org.tigris.subversion.subclipse.core.status.Status CacheManager.updateCache(StatusCacheManager.java:9 8)
    at org.tigris.subversion.subclipse.core.status.Status CacheManager.setStatuses(StatusCacheManager.java:2 46)
    at org.tigris.subversion.subclipse.core.status.Status CacheManager.basicGetStatus(StatusCacheManager.jav a:226)
    at org.tigris.subversion.subclipse.core.status.Status CacheManager.getStatus(StatusCacheManager.java:197 )
    at org.tigris.subversion.subclipse.core.status.Status CacheManager.getStatus(StatusCacheManager.java:141 )
    at org.tigris.subversion.subclipse.core.sync.SVNWorks paceSubscriber.getSyncInfo(SVNWorkspaceSubscriber. java:177)
    at org.eclipse.team.core.subscribers.Subscriber.colle ct(Subscriber.java:326)
    at org.eclipse.team.core.subscribers.Subscriber.colle ct(Subscriber.java:311)
    at org.eclipse.team.core.subscribers.Subscriber.colle ct(Subscriber.java:311)
    at org.eclipse.team.core.subscribers.Subscriber.colle ct(Subscriber.java:311)
    at org.eclipse.team.core.subscribers.Subscriber.colle ctOutOfSync(Subscriber.java:259)
    at org.eclipse.team.internal.core.subscribers.Subscri berSyncInfoEventHandler.collectAll(SubscriberSyncI nfoEventHandler.java:162)
    at org.eclipse.team.internal.core.subscribers.Subscri berEventHandler.processEvent(SubscriberEventHandle r.java:317)
    at org.eclipse.team.internal.core.BackgroundEventHand ler.processEvents(BackgroundEventHandler.java:369)
    at org.eclipse.team.internal.core.BackgroundEventHand ler$1.run(BackgroundEventHandler.java:203)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.j ava:54)

  3. #3
    Join Date
    May 2010
    Posts
    398

    Default

    Your post says that the error is "java.lang.OutOfMemoryError: PermGen space"

    However the stacktrace you posted shows a completely different error: "java.io.FileNotFoundException: /home/rd/pedro.ambrosio/Documents/workspace-sts-2.6.0.RELEASE/ehealthcom/application.properties (Too many open files)"

    So what is the actual problem? A permgen space problem or a "too many open files" problem.

    It's important to be clear about that since they are really totally different problems.

    If its a file limits issue, perhaps you could try upping the open files limit. I found a little article that explains how to do this in linux.
    http://lj4newbies.blogspot.com/2007/...pen-files.html

    If you are still seeing the problem after upping the limit, it could be there's some badly behaved piece of code that is opening but not closing files. In that case, please raise a Jira issue here
    https://issuetracker.springsource.com/browse/STS

    Since that is something we should look into.

    If it's a permgen error, I guess you probably pasted the wrong stacktrace. So please find the right one (it could help in determining what process is running out of permgen).

    Kris
    Kris De Volder -- SpringSource

  4. #4
    Join Date
    Apr 2011
    Posts
    11

    Default java.lang.OutOfMemoryError: PermGen space

    Dear Kris De Volder,

    Sorry about this situation/confusion, but I (think that I) have both problems.
    I'll increase the number of open files and I'll report the result.

    PS: "java.lang.OutOfMemoryError: PermGen space" message appears when I try run-app the application. If I war the project and deploy in Tomcat I don't have any problem.

    Thank you for your response,

    Best regards,

  5. #5
    Join Date
    May 2010
    Posts
    398

    Default

    So to be clear... the perm gen error happens if you use the menu "Run As >> Grails command (run-app)" right?

    That probably means that our launch configurations generated for this scenario allocate insufficient permgen memory for your app. I take it may be a fairly big app?
    Unfortunately, there's no way right now to change that (for the Run As >> Grails command"). See also this open bug report: https://issuetracker.springsource.com/browse/STS-1697.

    You should be able to create a special Grails launch configuration through "Run As >> Configurations" and then you can modify the meory setting by adding to its VMArgs there.
    Kris De Volder -- SpringSource

  6. #6
    Join Date
    Apr 2011
    Posts
    11

    Default java.lang.OutOfMemoryError: PermGen space

    Quote Originally Posted by Kris De Volder View Post
    So to be clear... the perm gen error happens if you use the menu "Run As >> Grails command (run-app)" right?
    Yes, if I run war I don't have any problem and the war file works OK in the Tomcat

    Quote Originally Posted by Kris De Volder View Post
    That probably means that our launch configurations generated for this scenario allocate insufficient permgen memory for your app. I take it may be a fairly big app?
    I upload to the project 70 new java files in src/java

    Quote Originally Posted by Kris De Volder View Post
    Unfortunately, there's no way right now to change that (for the Run As >> Grails command"). See also this open bug report: https://issuetracker.springsource.com/browse/STS-1697.

    You should be able to create a special Grails launch configuration through "Run As >> Configurations" and then you can modify the meory setting by adding to its VMArgs there.
    I'll also try and tell you the result.

    Thank you and best regards,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •