Saturday, April 11, 2009

Interactive Groovy console running on GAE/J

If you want to quickly test Groovy code on the GAE/J, then this small Groovy console way is a neat way to do it:
Try executing the following code to get some information about the GAE/J environment:

def p = System.getProperties()
p.keySet().each { println "${it}=${p[it]}" }
def r = Runtime.getRuntime()
println "processors=${r.availableProcessors()}"
println "freeMemory=${r.freeMemory()}"
println "maxMemory=${r.maxMemory()}"
println "totalMemory=${r.totalMemory()}"


  1. :-)

    It appears as if availableProcessors() on the GAE/J is hard-coded to return 1337. See this post.