Github user srowen commented on the pull request:
https://github.com/apache/spark/pull/7602#issuecomment-126593194
OK, on reading this further, I think there are different problems.
First, `indent` is increased, but never decreased. That's not how the
original worked. `indent` does not need to be a `StringBuilder` and shouldn't
be.
Second, there's no need to make a new `StringBuilder` inside each recursive
call. I thought the intent was to pass one down through all the recursions.
That is what should really drive some memory savings.
And if so, there is no need to return the `StringBuilder`; the top-level
caller already has a reference to it.
Finally, you don't want to catch `OutOfMemoryError` in general. It's not
likely recoverable.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]