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

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Works as Designed
    • Affects Version/s: 4.3.11
    • Fix Version/s: None
    • Component/s: 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

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

              Dates

              Created:
              Updated:
              Resolved: