I’d say that 40MB is a considerable size for a text-based message and SOAP is not a lightweight protocol.
Important - In the IS, a 40MB message doesn’t mean that only 40MB of memory is consumed in the pipeline. It depends on the number of child flows, levels of nested flows, whether you have used “Scope” in your flows and so on.
Usually, 1GB isn’t sufficient (or recommended) for a Production instance, even if it depends on the volumes, number of interfaces you’ve deployed and more.
Performance issues are tricky to investigate as the bottleneck could be anywhere - code, hardware (CPU type, cores, disk, OS configuration, etc.), performance of integrated systems such as databases and so on. The best way is to use the process of elimination.
My opinion - To me, it is obvious that your IS instance is struggling for resources; the problem and solution could be as simple as that.
Narrowing it down -
- Check your wrapper and instance logs to see what exactly caused the crash
- Use profiling tools such as jvisualvm and jprofiler to investigate your CPU and memory consumption further
- Using the above, determine if the issue is with CPU or RAM or Disk performance; if there are no obvious red flags with the hardware/OS, then the investigation becomes complex (i.e., code, memory objects and threads used by the IS instance)
- Ask if your instance is spec’ed and sized properly for the volumes and message sizes that you are trying to pump through?
- Perhaps you need to break the message down into chunks and then process them (read about large-file handling)
- Have you installed the latest fixes?
- Have you considered asynchronous integration (PubSub/JMS) and/or REST?