Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-4337

The payload transformer FileToStringTransformer results in an OutOfMemoryError in case of large file content

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Works as Designed
    • 4.3.11
    • None
    • File Support

    Description

      Got a java.lang.OutOfMemoryError: Java heap space when trying to copies a file's contents to a string using FileToStringTransformer on a massive file,

      The stack trace:

       at java.util.Arrays.copyOf(Arrays.java:3332)
              at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
              at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:596)
              at java.lang.StringBuffer.append(StringBuffer.java:367)
              at java.io.StringWriter.write(StringWriter.java:94)
              at org.springframework.util.FileCopyUtils.copy(FileCopyUtils.java:191)
              at org.springframework.util.FileCopyUtils.copyToString(FileCopyUtils.java:247)
              at org.springframework.integration.file.transformer.FileToStringTransformer.transformFile(FileToStringTransformer.java:54)
              at org.springframework.integration.file.transformer.FileToStringTransformer.transformFile(FileToStringTransformer.java:35)
              at org.springframework.integration.file.transformer.AbstractFilePayloadTransformer.transform(AbstractFilePayloadTransformer.java:87)
      

      Attachments

        Activity

          People

            abilan Artem Bilan
            ARoussi Roussi Abdelghani
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: