@arpit_bhayani "memory management is hard" is the usual answer, but is there a different POV on why most CVEs are memory mgmt issues ?
like the recent java4shell issue too was due to bit overflow.
Found this goated site by @semicolonydev
OS, Distributed Systems, networking, data structures and much more, love the site asthetics too.
https://t.co/aEM8VfPmRK
jcmd is cool.
You can observe the method-area (metaspace) size using it. The Method Area stores class metadata, static methods, and the runtime constant pool in a java program.
I used it on @intellijidea to observe its metaspace usage:
$ jcmd <pid> VM.metaspace
The results were wild (I opened a maven project with just https://t.co/Y8oFkaMoOo & print("hello-world")):-
• ~640 MB total Metaspace used
• ~128 MB of that is just Class space
• Over 119,000 classes loaded across 4,200+ classloaders
I always got confused why class Main {} has a static method as the starting point of a Java program: public static void main(String[] args)
And why inside this Main class, I need to declare other methods as static if I want to call them inside main().
Reason:
- static methods live in the Method Area (Metaspace), a memory region inside the JVM. The JVM is a process, so the OS allocates RAM to it.
- static methods don't need an object instance (e.g., new Foo()), so the JVM can invoke main() directly without creating a new Main() object first.
Similarly, if you want to use non-static methods inside Main, you first have to create an object:
var app = new Main();
app.greet();
I much prefer writing type-safe sql queries using JOOQ, rather than banging my head to figure out the right camelCase for JPA queries in my springboot projects.
JPA has it's place, I use it only for very simple CRUD ops.
@grok so no technical issues then ?, the only somewhat valid reason is "Servers can read it early without parsing the body" ? and sending Idem-Key as http header is standard practice ?
Is there an issue with sending Idempodency-Key as json field instead of an HTTP header ?
I've been reading blogs about idempodency, and almost everyone uses the "Idempodency-Key" HTTP header.
Is there a specific reason behind this ? @grok