Thank you for the replies! Because of everyone's insight, I was able to deduce that the problem was on our configuration.
Our heap size was 10 gigs so I don't think this is the problem since we only have 900k data. So when we took a closer look at our schema, 2 of the relevant fields has ShingleFilterFactory on query time so this caused the OOM for long q values! -- Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html