Comment by lunias
> it copies the memory of the current process into the new one
And if that memory is large enough then you OOM, so you would have to manage shared memory separately to prevent it from being copied into each process. It's not impossible, just complicated for some use-cases where using threads is a preferable paradigm.
> Look at the amount of code it takes to send an HTTP request in Java, versus Python
This is kind of my point.... (Java)
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder().uri(URI.create("https://api.example.com/data")).build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
versus (Python) response = requests.get('https://api.example.com/data')
Yes, it's more verbose, but not to the extent that I'd trade the compiler and performance for the less verbose version especially considering auto-complete in IDEs.
>And if that memory is large enough then you OOM
OOM is not an issue these days lol. Memory is dirt cheap, and the amount of memory that gets copied is miniscule per process.
There is still also the design of the application, just like with threading.
>(Java)
Forgetting the main class there, and also any additional headers that you need to send.