Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix explosion of already_processed #109

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

amw
Copy link
Contributor

@amw amw commented Dec 6, 2023

already_processed was unnecessarily appended and extended during CSS tags generation.

It was repeatedly calling a.extend(a) causing memory explosion. With my app's assets it quickly went to 16 GB and caused my Django process to be OOM killed.

You can test this behavior:

>>> a = list(f'some-hashed-path-{i}' for i in range(100))
>>> for j in range(100):
...     print(f'Iteration {j}')
...     a.extend(a)
... 
Iteration 0
Iteration 1
Iteration 2
Iteration 3
Iteration 4
Iteration 5
Iteration 6
Iteration 7
Iteration 8
Iteration 9
Iteration 10
Iteration 11
Iteration 12
Iteration 13
Iteration 14
Iteration 15
Iteration 16
Iteration 17
Iteration 18
Iteration 19
Iteration 20
Iteration 21
Iteration 22
Iteration 23
Iteration 24
Killed

`already_processed` was unnecessarily appended and extended during CSS
tags generation.
@amw amw force-pushed the fix-already-processed-explosion branch from fa67033 to cad4248 Compare December 6, 2023 10:55
@rix1
Copy link

rix1 commented Dec 6, 2023

+1 Also happened to me! Looking forward to getting this merged 🎉

@MrBin99 MrBin99 merged commit 66fce41 into MrBin99:master Dec 6, 2023
6 checks passed
@MrBin99
Copy link
Owner

MrBin99 commented Dec 6, 2023

Thanks !

@knokit
Copy link

knokit commented Dec 13, 2023

This also happened to me, had to downgrade to v2. Would be nice if this could be released. :)

@Niicck
Copy link
Collaborator

Niicck commented Jan 10, 2024

Hey ya'll. This has now been released in v3.0.2. Thanks so much for the fix!

@Niicck Niicck mentioned this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants