Garbage collection indeed depends on the system memory. It's lazy. That means it will collect less often if there is enough free space anyway.
You can read up on the details here.
The most important sentence for you:
Garbage collection occurs when one of the following conditions is true:
- The system has low physical memory.
If you have low overall memory, there will obviously be low free physical memory more often.