Influxdb-1.3.6 fatal error: out of memory

@bayendor , I upgraded influxdb to latest but still have same OOM issue.
I noticed, it happens if someone queries 1min interval data query for last 30 days.

Tried to change max-row-limit from 0 to 20000, even after that same OOM issue.

How can I rectify it?
Does max-row-limit help in this case? if yes how to know limit ?