[
https://issues.apache.org/jira/browse/IGNITE-7195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16320495#comment-16320495
]
Ryabov Dmitrii commented on IGNITE-7195:
----------------------------------------
??Upd: how about we limit GridToStringBuilder to 10000 chars by default to
avoid OOME in complex recursive obj graphs???
It will not help because some {{toString()}} methods have subsequent
{{toString()}} calls in their body like {{AbstractCollection}}. It creates
{{StringBuilder}}, which calls {{toString()}} of every element. They can call
other {{toString()}}'s and so on. So we need to parse inner objects manually
like in [IGNITE-602|https://issues.apache.org/jira/browse/IGNITE-602].
> GridToStringBuilder should limit large collections output to first N elements
> -----------------------------------------------------------------------------
>
> Key: IGNITE-7195
> URL: https://issues.apache.org/jira/browse/IGNITE-7195
> Project: Ignite
> Issue Type: Bug
> Affects Versions: 2.3
> Reporter: Yakov Zhdanov
> Assignee: Alexander Belyak
> Fix For: 2.4
>
>
> GridToStringBuilder should limit large collections output to first N elements
> (otherwise, OOME is possible). N should be limited by
> IGNITE_TO_STRING_COLLECTION_LIMIT system property and should be 10 by default.
> Upd: how about we limit GridToStringBuilder to 10000 chars by default to
> avoid OOME in complex recursive obj graphs? and (1) provide system property
> to change default and (2) also provide S.toString() overload that will accept
> maxLen parameter.
> Upd1: how about we add thread local message length counter in addition to
> thread local with buffers.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)