LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Ports on Java / Linux (Slightly OT)

[ILUG] Ports on Java / Linux (Slightly OT)

Mark Fallon mark.fallon at oracle.com
Wed Oct 4 12:50:36 IST 2000


Lorcan Hamill wrote:
> 
> My guess is that you're not calling Socket.close(), but just letting
> your socket objects go out of scope.  That's fine if the garbage collector
> kicks in, because the Socket's finalize() probably calls close(), but
> the gc just ain't happening.  This is quite common - the gc only kicks
> in if you're running low on memory - so it's easy to run out of
> non-memory resources if you're not careful to call "cleanup" methods
> like Socket.close() before letting your objects go out of scope.
> The GC on Windoze is probably more aggressive than the one you're now
> dealing with.
> 
> I could be wrong about all this - I've never seen this happen with
> sockets, but I *have* seen exactly the same problem with an app
> that processes ordinary files.
> 
> Good luck.
> 
> Lorcan
> 

You can force garbage collection with:

	System.gc();

You can also force finalize to be called on all objects
waiting for garbage collection with:

	System.runFinalization();	

Regards,

Mark
-- 
_______________________________________________________________

Mark Fallon			E-mail : Mark.Fallon at oracle.com
Senior Software Engineer	Phone  : +353-1-8033207
Global Product Engineering	Fax    : +353-1-8033221
_______________________________________________________________




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell