magento 2 does not use all ram of my system

I set PHP memory_limit to -1 and when I want to use di:compile command it is very slow. sometimes it needs over 4 min for a `di:compile’.
my laptop ram is 32G and hard is SSD.
already I use Linux (Ubuntu) and now, I use win 10.
is it a global problem or it is just for me?