How do you programmatically detect the application heap size ... There are two ways to think about your phrase "application heap size available":.
stackoverflow.com