Hi,
I ran into a problem and have now solved it after some good amount of
work.
My parameters to Liquid render include large models that include many
populated objects. -- I use Liquid for reporting.
Symptoms:
Rendering suddenly stops, and nothing seems to be happening. Watching
the server using top shows the process using up more and more memory
until it fails with a memory allocation error.
Cause:
In Liquid/lib/liquid/context.rb see method handle_error
The problem was that:
1) An error was be raised
2) The handle_error method was calling e.message
BUT, e.message was calling inspect on the arguments. Inspect was
trying to print enormous amounts of data. The system was failing with
a memory allocation error.
Debugging
Added a breakpoint at the entry to handle_error.
-- e is the error arg
in the debugger:
e.class => NoMethodError
e.name => gave the symbol (the method) that could not be found
e.backtrace => showed the backtrace
e.message => wouldn't evaluate (causes memory problem discussed
above).
Possible Liquid change:
Add to the handle_error case statement.
when NoMethodError then "Liquid error: NoMethodError #{e.name.to_s}"
Hope this helps...
Larry
ps. Thanks to Tobias and contributors for terrific software.