WIP: Try to discard data we don't need immediately when importing

Open username-removed-423915 requested to merge 38873-reduce-memory-for-import into master

What does this MR do?

Try to discard data we don't need immediately when importing

Are there points in the code the reviewer needs to double check?

I'll try to check if this could reduce memory footprint

Why was this MR needed?

To try use less memory

Does this MR meet the acceptance criteria?

  • Tests added for this feature/bug
  • Review
    • Has been reviewed by Backend

What are the relevant issue numbers?

Closes #38873