from the jack(1)d man page:
-M, --midi-bufsize [ event-count ]
Specify the size of the buffer used for MIDI ports. Units are "MIDI events per process() cycle", where an event occupies up to 4 bytes (as most common MIDI events do). The default buffer size is 2048 bytes, which is
about 500 MIDI events. Typical values for event-count will range from 10 to about 1000. Be aware that using very high values along with a large number of ports may cause JACK to fail to start because of the amount
of memory that would be required.