Bug 82804 Jar creation should use less memory
I noticed that the JarWriter will read the entire file it plans to store into memory. An optimization would be to stream the file directly into the JarOutputStream. The only catch is with STORED items which need the CRC32 computed. A penalty could be taken in that case to compute the CRC in a loop and then stream the file.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarPackageData.java
public IJarDescriptionReader createJarDescriptionReader(InputStream inputStream) {
		return new JarPackageReader(inputStream);
	}
	
	/**
	 * Tells whether this JAR package data can be used to generate
	 * a valid JAR.
	 * 
	 * @return <code>true</code> if the JAR Package info is valid
	 */
	public boolean isValid() {
		return (areGeneratedFilesExported() || areJavaFilesExported())
			&& getElements() != null && getElements().length > 0
			&& getAbsoluteJarLocation() != null
			&& isManifestAccessible()
			&& isMainClassValid(new BusyIndicatorRunnableContext());
	}
	/**
	 * Tells whether a manifest is available.
	 * 
	 * @return <code>true</code> if the manifest is generated or the provided one is accessible
	 */
	public boolean isManifestAccessible() {
		if (isManifestGenerated())
			return true;
		IFile file= getManifestFile();
		return file != null && file.isAccessible();
	}
	/**
	 * Tells whether the specified manifest main class is valid.