why are you not using CACHE clause which is precisely for the purpose :
cache
The optional clause CACHE cache specifies how many sequence numbers are to be preallocated and stored in memory for
fasteraccess. The minimum value is 1 (only one value can be generated at a time, i.e., no cache), and this is also the
default.