4 ms·
Ruby's external malloc problem
- pjungwir 8y agoI learned of this issue recently when someone corrected me on StackOverflow about using ActiveRecord::Base.connection.execute, which leaks memory, and pointed me to exec_query instead.[1] Here that behavior is why ActiveRecord can't lazy-allocate a result set. Sam is doing great work lately on ActiveRecord memory use; I've learned a lot reading his articles, and it sounds like he is really building up enough knowledge to implement some improvements. [1] https://stackoverflow.com/questions/4483049/how-to-execute-a-raw-update-sql-with-dynamic-binding-in-rails/24520455?noredirect=1#comment86619406_24520455 https://stackoverflow.com/questions/4483049/how-to-execute-a...