Monday, January 10, 2011

Query Connection in Postgresql

This sql can be used to query active connections in Postgresql database:
select * from pg_stat_activity;

PermGen Error on Tapestry

If your Tapestry application is displaying PermGen Error, it looks like you need to increase MaxPermGen value. According to http://tapestry.apache.org/specific-errors.html, you need to set -XX:MaxPermSize=512m in your JAVA options. Default MaxPermSize is only 64m.

The permanent generation is used to hold reflective data of the VM itself such as class objects and method objects. This is where class definitions go (and this explains why you may get the message OutOfMemoryError: PermGen space if an application loads a large number of classes and/or on redeployment).
If you're using Tomcat running as Windows Service, you can set this value on  Start->Program->Apache Tomcat->Configure Tomcat, and choose Java tab.



Note: Tapestry 5.2 needs bigger PermGen than Tapestry 5.1, but will consume lower heap memory (Maximum heap setting can be configured using: -Xmx600M).

Source:
http://www.mail-archive.com/users@tapestry.apache.org/msg47526.html
http://tapestry.1045711.n5.nabble.com/T5-5-2-4-and-memory-td3333624.html#a3333665
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
http://stackoverflow.com/questions/1634216/what-is-permsize-in-java

Access Git Repository behind HTTP Proxy

Use this command on Git Shell to set HTTP Proxy:
# export http_proxy=”http://10.0.0.1:3128″

http_proxy should be in lowercase.

Get source from Github

This is steps to get source from Github:
1. Download and install Git from http://git-scm.com/download

2. Go to your workspace folder and enter the following command:
# git clone http://github.com/hlship/tapestry5-hotel-booking.git