1. A method for performing garbage collection of memory objects in a memory heap, the method comprising the steps of: (a) partitioning said heap or portion thereof into at least two generations; and (b) applying substantially on-the-fly garbage collection to memory objects in at least one from among said generations, whilst running at least one program thread.