How to set storm worker's JVM max heap size?

Viewed 9252

I'm new to Storm programming and I've got a job to do a test on a custom grouping method to see if it's better or not.

So I have to measure the storm's throughput on several different conditions such as different worker numbers, different worker memory..etc

It's easy to set the worker number using conf.setNumWorkers();, however I find it hard to set each worker's max heap size.

I tried editing storm.yaml and added

worker.childopts: "-Xmn128m-Xms128m-Xmx128m"

with

conf.put(Config.WORKER_CHILDOPTS, "-Xmn128m -Xms128m -Xmx128m");

added to my code.

However when I use jmap -heap [pid] on my worker node, I found the max heap size is still 768m which is the default max heap size.

How can I achieve such purpose to restrain the JVM's max memory use?

BTW, I'm using kafkaspout to send messages to storm, any sorts of suggestions on my testing work is welcomed.

5 Answers
Related