3 ms·
Can you provide an examples of accidentally allocating memory? The only example I'm aware of is autoboxing which is huge misfeature IMO.
by vbezhenar 4y ago
Can you provide an examples of accidentally allocating memory? The only example I'm aware of is autoboxing which is huge misfeature IMO.
- kaba0 4y agoAny method call could allocate objects in their call trees, and it may not even behave consistently with new versions. But it is easy to monitor with Java’s killer observability.
- lenocinor 4y agoConcatenating lots of Strings instead of using a StringBuffer will do the trick. Sure, people who are familiar with Java know not to do that. But I’ve seen plenty of production code that concatenates.