max cmd line length only 4k in pgrep/pkill
The max cmd line length is 4K in pgrep -f:
https://gitlab.com/procps-ng/procps/blob/master/pgrep.c#L45
This is usually much less than POSIX ARG_MAX, and is especially painful for java programs which tend to use long cmdlines for passing classpath and use the very last cmdline argument as the class to execute (which is usually the string you want to pgrep).
I hereby kindly request to bump up this limit to at least 64k, if ARG_MAX doesn't seem right for you.