I am facing issue server execution timeout and sometime maximum memory used.

I want to insert 30k records into database from a CSV.

The issue is everything is going through the one loop.

I have changed the entries in wp-config and php.ini like excution time = 0 , maximum memory = -1 . This has solved the FATAL errors but leaking memory. HTTPD eats all my computer ram and still has to process 25K records.

I would like to release memory after every insertion (I am using wordpress default function to insert in to database not SQL).

I have searched alot and found that in SQL we can write GO after insert query this releases the memory but what we can do in wordpress.

I am using CSV import export plugin to import CSV. [Please don't recommend WP-All import it is not fulfilling my requirement to enter data in custom field in taxonomy].