I run aria2 1.31.0 for Win64 with parameters:
aria2c -i list.txt -c false -j 18
File list.txt is 126 MB in size and uses this format:
http://website.com/file1.txt
out=dir/file1.txt
for each of 1 950 000 files (yes, almost 2 million).
It quickly eats all the available RAM (over 15 GB) and doesn't even start downloading.
So it's not really "lightweight".
Since it is going to download only 18 files in parallel perhaps it could just load the file list bit by bit? Or store links in memory in a more efficient way? Again the whole list in TXT format is just 126 MB so perhaps it could load it as is into memory and then copy from it 1 MB chunks into an array, download everything from the array, empty it and copy next 1 MB part?
Or maybe I can already configure it somehow to eat less RAM?
Compiler: mingw-w64 5.0 (alpha) / gcc 6.2.1 20161118
built by x86_64-pc-linux-gnu
targetting x86_64-w64-mingw32
on Jan 16 2017 22:39:36
System: Windows 7 (Service Pack 1) (x86_64) (6.1)

I regenerated by list.txt with only 500 000 links. Now aria2 started and uses almost 6 GB of RAM.
So I think it needs about 24 GB of RAM for 2 000 000 links.
Aria2 saves the status of each download in memory, which is likely why you are having this issue. You may want to try using the --deferred-input option.
--deferred-input[=true|false]
If true is given, aria2 does not read all URIs and options from file specified by --input-file option at startup, but it reads one by one when it needs later. This may reduce memory usage if input file contains a lot of URIs to download. If false is given, aria2 reads all URIs and options at startup. Default: false
Thank you, it helped.
One thing was quite bothering. It started with 8 MB and was eating 1 MB more every 7 seconds. But it stopped at 18 MB so it's great. About 1 million links loaded.
If you are concerned with the memory usage, also try --disk-cache=0.
Most helpful comment
Aria2 saves the status of each download in memory, which is likely why you are having this issue. You may want to try using the
--deferred-inputoption.