My recommendation is to switch from occ to geo geometrical kernel. I am practically sure it solve your problem. I think it will be enough to change .occ. to .geo. in the names of the functions for that.
I have met similar problem recently. One could see my digging here - https://dev.opencascade.org/content/time-and-memory-consumption-gmsh-occt-operation.
Bon chance.