ObjectMemory.st
branchjv
changeset 18800 02724cc719b6
parent 18786 237a87b4fe8f
parent 18792 91839b570010
child 18873 ce58d469e583
equal deleted inserted replaced
18786:237a87b4fe8f 18800:02724cc719b6
  2794     "Modified: / 15.7.1998 / 13:28:05 / cg"
  2794     "Modified: / 15.7.1998 / 13:28:05 / cg"
  2795 ! !
  2795 ! !
  2796 
  2796 
  2797 !ObjectMemory class methodsFor:'garbage collector control'!
  2797 !ObjectMemory class methodsFor:'garbage collector control'!
  2798 
  2798 
       
  2799 allowTenureOf:anObject
       
  2800     "set the age of anObject back to 0 so it may eventually tenure
       
  2801      into old space. 
       
  2802      This should only be used in very special situations.
       
  2803      One such situation may be to ensure that an object is finalized early by the next
       
  2804      scavenge, and not by a (possibly late) old space collect.
       
  2805      To undo this setup (i.e. to allow the object to tenure again), set its age back to
       
  2806      any value with the seatAgeOf:to: message.
       
  2807      If the object is already old, this call has no effect.
       
  2808      WARNING: this method is for ST/X experts only
       
  2809               it is dangerous, should be used with care
       
  2810               and it may be removed without notice"
       
  2811 
       
  2812 
       
  2813     self setAgeOf:anObject to:0
       
  2814     
       
  2815     "
       
  2816     |p|
       
  2817     p := Point new.
       
  2818     Transcript showCR:(ObjectMemory preventTenureOf:p).
       
  2819     ObjectMemory tenuringScavenge.
       
  2820     Transcript showCR:(ObjectMemory ageOf:p).
       
  2821     ObjectMemory tenure.
       
  2822     Transcript showCR:(ObjectMemory ageOf:p).
       
  2823     ObjectMemory tenure.
       
  2824     ObjectMemory tenure.
       
  2825     ObjectMemory tenure.
       
  2826     Transcript showCR:(ObjectMemory ageOf:p).
       
  2827     ObjectMemory setAgeOf:p to:30.
       
  2828     Transcript showCR:(ObjectMemory ageOf:p).
       
  2829     ObjectMemory tenure.
       
  2830     Transcript showCR:(ObjectMemory ageOf:p).
       
  2831     ObjectMemory tenure.
       
  2832     Transcript showCR:(ObjectMemory ageOf:p).
       
  2833     "
       
  2834 !
       
  2835 
  2799 announceOldSpaceNeed:howMuch
  2836 announceOldSpaceNeed:howMuch
  2800     "announce to the memory system, that howMuch bytes of memory will be needed
  2837     "announce to the memory system, that howMuch bytes of memory will be needed
  2801      soon, which is going to live longer (whatever that means).
  2838      soon, which is going to live longer (whatever that means).
  2802      It first checks if the memory can be allocated without forcing a compressing
  2839      It first checks if the memory can be allocated without forcing a compressing
  2803      GC. If not, the oldSpace is increased. This may also lead to a slow compressing
  2840      GC. If not, the oldSpace is increased. This may also lead to a slow compressing