From the exception i could understand that 'Java can allocate 256M memory to an Array
1. Still i am unable to figure it out that how Heap size impect the declaration of BufferedImage Object?
2. And at what maximum horizontal/Vertical dimensions Java allow us to declare a BufferedImage Object?
Constructing a BufferedImage object leads to an array being allocated that can hold all of the image. The heap size needs to be big enough to hold that array. The stack trace tells you in which classes and methods this happens - you can look at the source code if you're interested in the details.
There is no limit that BufferedImage imposes; see my first post.
But it begs the question: What are you trying to achieve by declaring a 60000 pixel wide image? Nobody is going to be able to view that.
The image consumes roughly 60000*2300*4 = 526MB
Hello Dittmer, how did you calculate above value? Java BufferedImage.class tells that 'TYPE_INT_RGB' consumes 1 byte for one pixel?