I think your project is too ambitious. For example, replacing the existing JVM GC framework with alloc / free memory management would probably entail a substantial rewrite of the JVM native code codebase AND a redesign of the Java class library.
(Did you know that a checkout of the Java 11 OpenJDK source repo is 2.5 Gbytes? There's a lot of code there. Look before you leap.)
You asked:
Would it be efficient to use manual garbage collector instead of automatic garbage collection?
In my opinion, No:
As was demonstrated a long time ago (see the classic Zorn paper), for large applications an automatic GC is as fast as (if not faster than) storage management using malloc/free with smart pointers.
The entire Java class library is designed on the assumption that GC is automatic and efficient. If you change that, then much of the current API design is problematic; i.e. it would leak heap objects.
However, if you put 10 or so man-years of skilled dev effort into the project, you may end up with a different answer. (And probably a very different programming language!)
Is it common to use manual GC in industry?
With Java it is unheard of.
In languages such as C / C++ that were not written with automatic GC in mind, it is still common to use manual storage management. (But not universal. Read about the Boehm conservative collector.)
Or do programmers use automatic garbage collector everywhere?
With Java, yes.
In many other programming languages yes. But not all languages.
Reference:
- "The measured cost of conservative garbage collection" by Benjamin G. Zorn, Published in Softw., Pract. Exper. 1993. DOI: 10.1002/spe.4380230704