One of the things my Java application running on Linux is doing creating directories. All directories are created in /a/b/c, which at this point contains 31998 subdirs.
Evidently this is enough to not allow any more to be created.
With this 2 questions:
It depends on your filesystem. The following thread has more information on the limits of various filesystems:
What is the maximum number of folders allowed in a folder in Linux?