How to know the current bounds of HEAP.

And my main concern is that I have to specify the length of the character array at the time of declaration which is hard for me to predict.

What are you using Strings for where you can't deal with a reasonable amount of the data at a time?