Github user joewitt commented on a diff in the pull request: https://github.com/apache/nifi/pull/328#discussion_r58706787 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java --- @@ -91,12 +92,22 @@ + " that the memory pool is exceeding this threshold.") public class MonitorMemory extends AbstractReportingTask { + private static final AllowableValue[] memPoolAllowableValues; + + static { + List<MemoryPoolMXBean> memoryPoolBeans = ManagementFactory.getMemoryPoolMXBeans(); + memPoolAllowableValues = new AllowableValue[memoryPoolBeans.size()]; + for (int i = 0; i < memPoolAllowableValues.length; i++) { + memPoolAllowableValues[i] = new AllowableValue(memoryPoolBeans.get(i).getName()); + } + } + public static final PropertyDescriptor MEMORY_POOL_PROPERTY = new PropertyDescriptor.Builder() .name("Memory Pool") .description("The name of the JVM Memory Pool to monitor") .required(true) - .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) - .defaultValue(null) + .allowableValues(memPoolAllowableValues) + .defaultValue(memPoolAllowableValues.length == 0 ? null : memPoolAllowableValues[0].getValue()) --- End diff -- I think we're better off simply not having a default value.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---