Unfortunately, there's not much I can do to fix that. I haven't tried uploading a 25MB file via the plugin. You might need to increase your java heap space given to the Jenkins server. Can you tell what the upward limit is for the attachment in your JVM?
There's only one way to add an attachment in this API, and if the axis client is unable to attach it within the JVM heap provided, the plugin will not be able to do anything to fix that. From the Confluence documentation, it states:
Attachment addAttachment(String token, long contentId, Attachment attachment, byte attachmentData) - add a new attachment to a content entity object. Note that this uses a lot of memory - about 4 times the size of the attachment. The 'long contentId' is actually a String pageId for XML-RPC.