We are using multipart content type as shown below.
Content-Type: "multipart/form-data; boundary=pOnbFW_YNccp2iCWIsec4ZXHD4v2mbj50xn-Xpw"
After few hours of load testing we notice that OldGen space is all used up and Full GC start to kick in. Heap dump analysis shows that in 2G Heap, 1G was occupied by javax.ws.rs.core.MediaType objects. There were 1.7 million of them. RestEasy seems to use this objects to cache HTTP content-type, and they won't ever get released. Normally content-type is fixed String. However, in multipart type, boundary value changes and this might cause new MediaType creation on every call.