Well how much the application needs changes based on the size of input.
Sure, there's nothing unusual about that. But I don't see how it helps to know how much physical memory is available. No matter what the answer is, you don't have infinite memory, so if you have an application that can potentially use infinite memory (again, nothing unusual about that) then you need to write it so that it deals with that problem somehow. And then pick a non-infinite number that you can make it work within.
It's pretty standard for packaged software to say "Requires X MB memory to run". Seems to me that Java programs should be entitled to say the same thing.
And the last time I put a number there that was equivalent to the physical ram on my machine it crashed either the application or the machine
I have 256 MB of physical memory on my home system and I run a Java application with -Xmx400M in the command line, with no problems.