IdentityMap, Memory leaks, and reference counting

L

listrecv

A simple IdentityMap (for O/R mappers, like ActiveRecord) can be coded
in a few lines of Ruby - but, it will cause memory leaks, as a a
reference will be kept even when no one else has one.

Is there anyway to tell Ruby not to count a particular reference
towards garbage collection.

EG:
def store(product)
map[Product][1422] = NoRefCount(product)
end
 
L

listrecv

Sam,

Thanks for the, er, reference.

I thought about scoping to a UnitOfWork. But my intended application
is to drop in to ActiveRecord (after spending too long puzzling over a
bug that IdentityMap's are supposed to solve), and introducing a UOW
would change the entire way AR is used.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top