Returning a global accumulator

Hi,

Accordingly to the query best practice documentation one should (for global accumulator collections) run .clear(); to ensure memory is available for re-use. If one returns a global accumulator, what will happen? Is this a potentially a memory leak or will the memory be free by another mechanism? If the former how should one reason here to avoid this? E.g. define a local stack variable and copy the content of the accumulator to this one to return?

Thanks,

Anders Lauri

After the query execution, the memory of the runtime data structures will be automatically released.

When it returns it does copy.

Thanks.