[Solved] why programs like c and c++ use less storage than java programs


Two arrays of 10^9 will use GBs of memory in any language. e.g. 2 * int[10^9] requires 8 GB of memory, whether you use C or Java.

The real solution is likely to be to not create the arrays at all as they don’t appear to be needed. You can process the data as you read it. This will use next to no memory whether you use Java or C.

2

solved why programs like c and c++ use less storage than java programs