On 03/29/2015 04:52 AM, Sergey Mironov wrote:
What memory allocation mechanism does Ur/Web use for making
nested purely-functional calls?

It's all region-based memory allocation, a scheme not really designed for intensive computation with many intermediate results.

What can I do to reduce the memory consumption?

Structure your code so that many intermediate computations have types like [int], so that the compiler sees that intermediate values can be freed safely afterward. The same optimization applies hierarchically for trees of nested computations, where many [int]s are computed using many intermediate [int]s, etc.

The general rule is that intermediate values are freed after computations of types built out of [int], [float], etc. using further layers of record types.

_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to