arakelian / java-jq

Lightweight Java wrapper around JQ, a flexible JSON processor available for multiple platforms
MIT License
82 stars 10 forks source link

Large input? #29

Open spoerri opened 2 months ago

spoerri commented 2 months ago

How should java-jq be used on a large input, that is with a large number of small json objects? The jq command line app handles it fine, filtering out individual json objects and translating them one-by-one. Using the java-jq naively as in the README.md, I get:

Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
    at java.lang.StringCoding.encode(StringCoding.java:350)
    at java.lang.String.getBytes(String.java:941)
    at com.arakelian.jq.JqRequest.parse(JqRequest.java:263)
    at com.arakelian.jq.JqRequest.parse(JqRequest.java:233)
    at com.arakelian.jq.JqRequest.jq(JqRequest.java:178)
    at com.arakelian.jq.JqRequest.execute(JqRequest.java:58)
    at com.cantor.aqdev.core.eventviewer.EventViewerJq.main(EventViewerJq.java:27)