Bug 75206 [Import/Export] Export large file using Export filesystem wizard causes OutOfMemory
I have a project which creates a large output file (a filesystem image). Eclipse reports the size as 409600000 bytes. If I try to export this file using the Export->File System wizard, I quickly get an out of memory error. I set the max heap size to 256M (-Xmx256M).
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/FileSystemExporter.java
int chunkSize = contentStream.available();
            byte[] readBuffer = new byte[chunkSize];
            int n = contentStream.read(readBuffer);
            while (n > 0) {
                output.write(readBuffer);
                n = contentStream.read(readBuffer);
            }
        } finally {
            if (output != null) {
				output.close();
			}
            if (contentStream != null) {
				contentStream.close();
			}
        }
    }
    /**
     *  Writes the passed resource to the specified location recursively
     */
    protected void writeResource(IResource resource, IPath destinationPath)
            throws CoreException, IOException {
        if (resource.getType() == IResource.FILE) {
			writeFile((IFile) resource, destinationPath);
		} else {
            createFolder(destinationPath);
            writeChildren((IContainer) resource, destinationPath);
        }
    }
}