It's pretty unlikely you can do anything in your code to solve this. A more detailed analysis might discover the cause: clearly it isn't the count of elements itself. Maybe there are many form XObjects, maybe there are font issues, who knows... if you have a file you can share (do not email!) others might be interested.
If you just want to ADD content, you could create a form XObject and add it as an overlay. If really adventurous you could use the Cos layer to do that.