Memory usage relation with select query on influxdb

We have been using InfluxDB for over an year now and recently we have started seeing a bulge in memory usage when select query has around 10 million points.
Need to understand the relation b/w resultset and memory & the best practices to optimize that.

Cluster Details
RAM - 64GB
Disk - 1TB
CPU - 8 core
Retention policy - 1 month
Series cardinality - 500
Number of points - 30 million

@anirudhbh If you have enterprise, I would recommend talking with support. On open source, we might be able to make some adjustments in your config to help. Which version are you using?