I am trying to find out programatically the max permgen and max heap size with which a the JVM for my program has been invoked, not what is currently available to them.
As for eclipse, try looking for a profiling tool. I think NetBeans has one by default.