bugKawa - Bugs: bug #15876, Ports are not reclaimed...

 
 

bug #15876: Ports are not reclaimed automatically when becoming inaccesible

Submitted by:  None
Submitted on:  Thu 23 Feb 2006 01:40:21 AM UTC  
 
Category: Scheme librarySeverity: 3 - Normal
Item Group: Unexpected resultStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 12 Dec 2006 07:00:09 PM UTC, comment #4:

I checked in a fix so WriterManager uses WeakReference.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Thu 09 Mar 2006 06:08:52 AM UTC, comment #3:

Yes, that works. Thanks.

Anonymous
Sat 04 Mar 2006 07:48:17 PM UTC, comment #2:

I believe this was fixed in CVS by this change:

2005-12-21 Per Bothner <per@bothner.com>

  • OutPort.java (closeOnExit): New method.

(<init>): Only register with WriterManager if closeOnExit().

  • CharArrayOutPort.java (closeOnExit): New method - returns false.

This fixes a memory leak - CharArrayOutPort were not being collected.

Now it might also be worth considering using weak references in WriterManager. But in any case could you check whether the 2005-12-21 change fixes the problem for you?

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Fri 24 Feb 2006 06:54:51 PM UTC, comment #1:

Looks like WriterManager keeps strong references to the ports. Maybe it should keep weak references?

Anonymous
Thu 23 Feb 2006 01:40:21 AM UTC, original submission:

The following will throw an OutOfMemoryError if the port
is not explicitely closed.

(let ((build-string
(lambda ()
(let ((op (open-output-string)))
(let ((str (get-output-string op)))
;;(close-output-port op)
str)))))
(do (((i :: <int>) 1000000 (- i 1))
(x (build-string) (build-string)))
((< i 0) x)))

The documentation says:

The port can be closed by the procedure close-output-port,
though its storage will be reclaimed by the garbage collector
if it becomes inaccessible.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 12 Dec 2006 07:00:09 PM UTCbothnerStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sat 04 Mar 2006 07:48:17 PM UTCbothnerAssigned toNone=>bothner

    Back to the top


    Powered by Savane 3.1-cleanup1