When i start nifi with ambari i get this error Java Heap Space OutofMemory but when i start it with console by script nifi.sh i get no error
Which version of HDF are you using? There was an issue reported in older version with toolkit heap setting. The default heap setting for encryption utility is -Xms128m -Xmx256m , which is hardcoded in the encrypt-config.sh script file.
Please refer to the following SupportKB which might help in fixing your issue.