Welcome Guest, Not a member yet? Register   Sign In
Datamapper memory consumption ? 16Mb exhausted on small query
#4

[eluser]OverZealous[/eluser]
Well, there is nothing technically wrong with that code. It's just that DataMapper isn't optimized for displaying a lot of individual objects like that - it's more optimized for manipulating objects.

The reason it uses so much RAM is that each MyClass requires a complete object, with a lot of properties and overhead. It isn't noticeable for a few hundred objects, but 2000 is a lot.

Anyway, did you try the code I mentioned above? It should reduce your peak RAM usage. Otherwise, for such a special case, I would be tempted to just run a normal query (for this instance). You aren't really doing anything in your example code that makes using DM seem worth the overhead.


Messages In This Thread
Datamapper memory consumption ? 16Mb exhausted on small query - by El Forum - 03-09-2009, 03:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB