looks like a memory issue
Yeah, probably, and additionally you will get client side performance issues in the frontend. 5000 simple products in one configurable product is way too much for Magento.
I'll quote myself from a recent forum thread:
While there is no enforced limit, Magento does not handle big numbers
of associated products efficiently. For example the price data for
each associated product is loaded into one big JavaScript object
(JSON). And database queries on the product page are another
bottleneck, especially if you use the swatches feature.
We have a
similar situation but with even higher numbers and are currently
working on our own lightweight configurable product type.
The rough concept:
- data for associated products is stored as flat data structure (probably a NoSQL storage): configurable attributes, price rules, skus
(add more if needed)
- optimize data in frontend to not pregenerate data for each combination (for example calculate price on the fly)
- when a product is ordered, a real simple product based on the selection is created temporarily. This allows us to use all sales
features without code changes
This is just to give you an idea that for a use case like yours you
will need a customized solution.