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/internal/ui/jarpackager/JarFileExportOperation.java
retVal[0]= true;
				} catch (InvocationTargetException ex) {
					addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingModifiedResources"), ex); 
					JavaPlugin.log(ex);
					retVal[0]= false;
				} catch (InterruptedException ex) {
						Assert.isTrue(false); 
						retVal[0]= false;
				}
	 		}
		};
		fFilesSaved= false;
		display.syncExec(runnable);
		if (retVal[0])
			fFilesSaved= true;
		return retVal[0];
	}
	private IRunnableWithProgress createSaveModifiedResourcesRunnable(final IFile[] dirtyFiles) {
		return new IRunnableWithProgress() {
			public void run(final IProgressMonitor pm) {
				IEditorPart[] editorsToSave= getDirtyEditors(fParentShell);
				pm.beginTask(JarPackagerMessages.getString("JarFileExportOperation.savingModifiedResources"), editorsToSave.length); 
				try {
					List dirtyFilesList= Arrays.asList(dirtyFiles);
					for (int i= 0; i < editorsToSave.length; i++) {
						if (editorsToSave[i].getEditorInput() instanceof IFileEditorInput) {
							IFile dirtyFile= ((IFileEditorInput)editorsToSave[i].getEditorInput()).getFile();					
							if (dirtyFilesList.contains((dirtyFile)))
								editorsToSave[i].doSave(new SubProgressMonitor(pm, 1));
						}