Hi
About tomcat i can say , its startup application (service manager in windows)
you can specefy the memory stuff under
java tab of tomcatw.exe .
you can use bath or shell files that start tomcat to define the memory that it use.
for example in linux you can use -Xmx256m ,Xmm64m or any number to define tomcat maximum , minimum memory.
about weblogic i can not comment .