Well, the stream (i.e. the object) itself needs some space - it has about a dozen variables and objects (and I'm too lazy to correctly count them), but it should be a little more than maybe 200 bytes (you need it would be to count all the primitives and links [trivial, those have fixed sizes, but the links depend on your virtual machine], and then calculate the size of all objects that are highlighted by the class [the VM hotspot has an overhead of 2 words per object (3 if there are no local variables in the object) and n and the border is 8 bytes])
What really takes up space is the local thread stack, and the -Xss flag can affect it (although note that each OS has some restrictions on the maximum stack space, you can influence this with -ulimit in linux and of course somehow in the windows).
By default for an access point:
In Java SE 6, the default is Sparc 512k on a 32-bit VM and 1024k on a 64-bit virtual machine. On x86, Solaris / Linux is 320k on a 32-bit VM and 1024k on a 64-bit virtual machine.
On Windows, default thread stacks are read from binary (Java.exe). Starting with Java SE 6, this value is 320k in a 32-bit virtual machine and 1024k in a 64-bit virtual machine.
source share