Elastic Agent memory consumption

Is there any ways to limit the memory used by elastic-agent. Elastic Agent and Endpoint are consuming around 2GB memory. This is too high for a tool like elastic agent. Any help/tips for reducing memory usage is highly appreciated!