Thanks for the replies everyone. Ideally I don't want to mess with the JVM parameters as I don't want any roll on effects which might cause gateway performance to be affected.
This is very helpful information @paul-griffith and @pturmel I had a bit more of a look inside. I am transferring data in and out of perspective session properties as a temporary storage area to work on the data. I have some code that communicates with gateways, pulls the data across and then joins it together and stores it in a perspective session component for manipulation and export (or sending back to the gateways immediately if desired).
Is there a better place to store this type of information? I was using the perspective session properties because it is persistent across a single session (which is relevant for this as I don't want to use a gateway tag etc as I want the data unique to a particular session so users cannot affect each others data). The data all comes in asynchronously from the gateway network as the operations take quite a while for the gateways to perform which can lead to timeouts otherwise.
(screenshot below of the download inside of the perspective session, I'm using a much smaller dataset here to try and get the operation to succeed)
and likewise an unsuccessful operation with significantly more data below (with the grey "No Connection to Gateway" banner)
Thanks again.

