I am using Jersey as my REST implementation and JAXB to represent my classes. I have done a tiny file transfer mechanism. At the client side the file is converted to a BASE64 string before I set it to the JAXB object. The JAXB object is then sent to the server with Jersey.
It works with files not larger than 50 MB or so, but when I try to send a 500 MB file I get OutOfMemoryError
on my client. I have set the -Xms
and -Xmx
to 2048m but it does not help, I still get the error.
What can I do to get it work with very large files?