• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Grails memory usage

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of the things I have noticed playing around with Grails is that it uses quite quite a bit of heap memory and permgen space. Does your book cover any hints or tips on reducing the memory footprint of a Grails app?
 
Author
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,

My book does not specifically cover this. Although my first thoughts are that there two potential causes of high memory usage.

1) The large number of frameworks that Grails builds on. It uses Hibernate and Spring under the hood so loading all of these classes is going to take up some memory. For single web applications deployed to a Tomcat server this will probably not cause issues, so long as you give the server a realistic amount of memory (512M). Deployments that require a number of Grails applications to run under one Tomcat instance may want to look at packaging the applications so they can share Spring and Hibernate libraries. This is not covered in the book.

2) Application design. If the domain objects are implemented to perform eager fetching on their relationships then you could experience memory problems as too much data is loaded on every request to the database. This is covered in the book when I talk about n+1 query performance problems.

Cheers,
Jon.
 
reply
    Bookmark Topic Watch Topic
  • New Topic