RE: java.lang.OutOfMemoryError during downloads
RE: java.lang.OutOfMemoryError during downloads
- Subject: RE: java.lang.OutOfMemoryError during downloads
- From: "Kranthi Sagar Borra" <email@hidden>
- Date: Tue, 2 Dec 2003 11:54:39 +0530
- Thread-topic: java.lang.OutOfMemoryError during downloads
Hi Cornelius,
I think you are right, the NSData is actually creating a problem.i did not have this problem during upload because I am using WOFileUpload component which is streaming the data directly from the client to the server.But I think there is no such component for file download.can somebody tell me if there any way by which I can stream the data from server to the client.And cornelius I could not find any resourcestreaming framework at www.cluster9.com .Can you please tell me where exactly I can get this
Regards,
Kranthi Sagar
> ----------
> From: Cornelius Jaeger
> Sent: Friday, November 28, 2003 7:17 PM
> To: Apple Webobjects List
> Cc: Kranthi Sagar Borra
> Subject: Re: java.lang.OutOfMemoryError during downloads
>
> hi Kranthi,
>
> don't use an nsdata object, stream the file from the filesystem to the
> browser directly.
> go to www.cluster9.com and download their resourcestreaming framework.
> it avoids using nsdata objects which load the entire data into memory,
> hence the out of memory error.
>
> hth
>
> cornelius
>
>
> On Nov 28, 2003, at 6:16 AM, Kranthi Sagar Borra wrote:
>
> > Hi
> > if i am not wrong the streamlioning functionality in webobjects is to
> > overcome the problem of uploading and downloading huge files
> > right.Please correct me if I am worng.But now I am uploading a file
> > (<filename>.tar.gz) of size 17.2 MB.The upload is happening
> > prperly.But now if i downlod the file from the application server to
> > the users desktop ,I am getting the following error
> > .
> > 2003-11-22 11:19:59 IST] <WorkerThread0> <WOWorkerThread id=0
> > socket=null> Throwable occurred: java.lang.OutOfMemoryError
> > [2003-11-22 11:19:59 IST] <WorkerThread0> java.lang.OutOfMemoryError
> > <<no stack trace available>>
> >
> > [2003-11-22 11:19:59 IST] <WorkerThread0> <WOWorkerThread id=10000
> > socket=null> Workerthread exiting due to error, respawning with ID
> > 10000...
> > com.webobjects.foundation.NSForwardException for
> > java.lang.OutOfMemoryError
> > <<no stack trace available>>
> >
> > .I am not very sure of what this error is.But I think this error has
> > occured because of low memory.But this should not happen because of
> > streamlining functionality.Can you please tell me why this has
> > occured.While downloading the file, i am actually sending it from the
> > application server by appending it to the response object.Below is the
> > code for the same.Please tell me if I am going wrong somewhere.
> >
> > public void appendToResponse(WOResponse aResponse, WOContext
> > aContext) {
> >
> >
> >
> >
> > aResponse.setHeader("application/octet-stream","content-type");
> >
> >
> > aResponse.setHeader("attachment;filename=\"" +
> > downloadFileName +
> > "\"", "content-disposition");
> > try{
> >
> > aResponse.appendContentData(data.dataWithContentsOfFile(filePath));
> >
> > }catch(IOException ex){
> > ex.printStackTrace();
> > }
> > aResponse.setContent(data);
> > isdownloaded=false;
> >
> > }
> >
> >
> >
> > Regards,
> >
> > Kranthi Sagar
> > Extn:6799
> > Direct:0824-2226799
> > Cell:9845791246
> > _______________________________________________
> > webobjects-dev mailing list | email@hidden
> > Help/Unsubscribe/Archives:
> > http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> > Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.