🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #917

Re: OutOfMemoryError

#917
From: Owen Green
Date: Thu, 04 Jul 2002 11:08
46 lines
2709 bytes
"Alan Shiers" <ashiers@hfx.eastlink.ca> wrote in message
news:3D233ADD.C365148D@hfx.eastlink.ca...
> For some reason, when I split things up this way it generates this "Bad
> file descriptor" error.  I still don't know why that is.

Could've been duplicating the FD's somewhere and getting confused? Are FD's
ThreadLocal?

> Anyway, for the sake of expediency, I've cut out the use of the worker
> thread for now and have placed all the code in the uploadFile() method.
> Now, I don't get the "Bad file descriptor" error.
>
> However, now I'm faced with a new dilemma. The while loop hangs on the
> server-side app!
>
> The client-side app definitely completes and exits the while loop, but
> not on the server-side app.
>
> When I place a System.out.print(n + ", "); statement inside the loop on
> the server-side app, I get:
>
> 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
>
> Then it just hangs there waiting to read in more. When I terminate the
> server-side app the line continues to add a four on the end:
>
> 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 4,
>
> The next printlin statement tells me it finally closed the stream. But
> only after I shut down the entire app.

Are you definately closing the files when you're done? e.g.

FileInputStream fis = null;
try{ 
  /* do stuff */ 
} 
finally{ 
  try{fis.close();}catch(IOException ioe){ioe.printStackTrace();} 
} 

If you post your entire uploadFile() method (if its not too huge), it will be easier to see what's happening. 

hth 
Owen 
Technical Details
Message-ID: <3d242c96_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!logbridge.uoregon.edu!netnews.com!xfer02.netnews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3D20CC5D.B70473C9@hfx.eastlink.ca> <MPG.178acb912dba8f7998b79d@newsgroups.borland.com> <3D21C1CA.F2D953E2@hfx.eastlink.ca> <3d21bb44_1@dnews> <3D21EC78.228A5CD3@hfx.eastlink.ca> <3d21e07b_2@dnews> <3D226288.1C7C905@hfx.eastlink.ca> <3d22ec28_1@dnews> <3D233ADD.C365148D@hfx.eastlink.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,28eab50e784856ac
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-07-04 04:11:32 PST
From: "Owen Green" <owen@begonefoulmachine.kennulz.demon.co.uk>
Newsgroups: borland.public.jbuilder.java.api
References: <3D20CC5D.B70473C9@hfx.eastlink.ca> <MPG.178acb912dba8f7998b79d@newsgroups.borland.com> <3D21C1CA.F2D953E2@hfx.eastlink.ca> <3d21bb44_1@dnews> <3D21EC78.228A5CD3@hfx.eastlink.ca> <3d21e07b_2@dnews> <3D226288.1C7C905@hfx.eastlink.ca> <3d22ec28_1@dnews> <3D233ADD.C365148D@hfx.eastlink.ca>
Subject: Re: OutOfMemoryError
Date: Thu, 4 Jul 2002 12:08:01 +0100
Lines: 53
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 193.237.54.9
Message-ID: <3d242c96_2@dnews>
X-Trace: dnews 1025780886 193.237.54.9 (4 Jul 2002 04:08:06 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!logbridge.uoregon.edu!netnews.com!xfer02.netnews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews