
Top 5 Java troll moments
Memory limit is not a real memory limit 🤔 I can define heap memory limit for the JVM... But the actual memory usage can end up being 10% higher, or 20%, or even 50% higher, because native memory allocations are not counted as heap memory My app will use all available memory inside the container and crash, even though I thought I set a limit... What? At this point, why even have a memory limit at all? Reserved words that do nothing 🅰️ const is a reserved keyword, but I cannot define a constant value with it _ underscore is also a reserved keyword, but it cannot be used until Java 25. It took 10+ years from keyword introduction to actual implementation. No way... Better later than never? Character to number implicit casting 🔟 It is possible to create string builder from character: new StringBuilder('a') . But 'a' will be treated as integer 97. What the heck... ForkJoinPool.commonPool() 📊 The number of available threads is limited to the number of CPU threads If some tasks spawn other tas
Continue reading on Dev.to
Opens in a new tab




