Memory Problem based on ToString()
- Dominant language
- Java
- Stars
- 276
- Forks
- 223
- PR merge metrics
- No merged PRs in 30d
Description
Having memory issues with the generated POJO based on SObject, the problem is the toString method, right now is printing the whole object and its dependencies when dealing with huge objects it's generating an overhead of memory usage
java code example:
```
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[CustomObject ");
sb.append(super.toString());
this.toString1(sb);
sb.append("]\n");
return sb.toString();
}
```
template example:
```
@Override
public String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
sb.append("[$gen.className$ ");
$gen.superToString$
$gen.splitMemberMetadataList: { split | toString$i$(sb);
}$
sb.append("]\\n");
return sb.toString();
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the generator template containing the shown toString implementation and trace how generated POJOs inherit or render SObject dependencies. Confirm the intended behavior for huge objects, then add coverage for the generated toString output and verify that it no longer creates the reported memory overhead.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100