Skip to content
Discussion options

You must be logged in to vote

import is specially implemented in Python to not do anything if it's called a second time. In contrast, spacy.load doesn't know if it's been called before, so it loads things from disk and creates new structures in memory. Since you are shadowing the old variable, after garbage collection is run the extra memory from the second call should go away, but there's no guarantee it happens immediately.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Salekeen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf / memory Performance: memory use
2 participants