I want to know, why java (or gc-based languages like C#, GO) haven't any tools for direct memory management tools in addition to gc.
I am familiar with JLS and JVM spec, but I didn't find out any explanation of that.
It can boost performance (reducing amount of work for gc) and can decrease amount of used memory when developer can directly delete objects that he surely know aren't needed anymore.
I'm not familiar with python memory specification, but I know, that there are gc() method and keyword del for memory management.
P.S. I was googling for an hour, but I only find answers describing that I shouldn't care about deleting objects in memory management languages.
Java has always been security focussed, though never as important as ease of use. Non-garbage collected memory management is difficult to guarantee memory safety use, though see Rust for a good stab at it.
Good JVM implementations can stack-allocate "heap" objects in some time-critical circumstances. GC for short lived objects is incredibly fast anyway.
You can allocate memory outside of GC using the standard Java Class Library - java.nio.ByteBuffer.allocateDirect
. There isn't as yet, IIRC, a way to explicitly deallocate. That is does indeed require the GC to trace down all the references. The API will work well if you need fixed arrays of primitives that will last as long the process.