The problem might well be an inordinately large Ipfw.conf.
This is what the output of the wc command states.
The ipfw likely was written with the presumption that the config file can only be a small file. Your conf probably overran the allocated memory for the config.
Next, if you need 10,000 rules on your firewall, then something is wrong with your approach. Can you succinctly define needed rules in pseudo code or actual ipfw grammar? Then we can devise a streamlined ruleset.
F.