My application crashed if the number of parts is large

My application assembles some parasolid files into SolidWorks files.

 

My application runs normally if the number of files is small.

However it crashed if the number of files is large.

 

My application used about 4GB memories when it crashed,

but my machine has more than 10GB memories.

 

I ran my application on several machines. They all crashed, but the numbers of files are different

when error occurred.

 

Errors occurred in two API Functions,

they are ISldWorks::INewDocument2 and IModelDoc2::SaveAs2.

I doubt there are limitations about the number of parts.

   

Are there any limitations about the number of parts in SolidWorks?

Or are there any settings about the number of parts?

 

Incidentally I set enough large value about large assembly mode.

SolidworksApi macros