If that is the case then you get to set -L by trial and error.
Sometimes, one can be more proactive than that. E.g., I had a case where the application as a whole was well behaved and -L could normally be quite low, but then there was one site that had a customer who regularly paid 7-8,000 invoices with a single check (publisher selling to Barnes and Noble with a separate invoice for every shipment to every store). The design of the application was such that there were three locks for every invoice and it was reasonable design, at least at the time, for making applying to all invoices a single transaction. So, we set -L to be large enough to handle that set of locks plus a bit for everyone else and all went smoothly.
In a more modern architecture one might design the application differently to avoid making it all one transaction, but this is an example where one can understand the business rule and accommodate it in a controlled fashion rather than just making it arbitrarily large to cover over bad code.