editor
editor copied to clipboard
Memory usage explosion when searching in all files
Description
When searching in all files, memory usage sometimes increases to huge amounts. Maybe its searching files that it shouldn't? If this happens, the search will also freeze.
https://user-images.githubusercontent.com/15365765/174808920-96d51325-b31d-41a5-a42c-a6777275e374.mp4
Steps to Reproduce
- Open the code editor
- Search for something in the Find in files tab (ctrl+shift+f)
- Memory usage explodes and the search freezes
Duplicate of https://github.com/playcanvas/editor/issues/720 possibly?
In that gif, not sure where upper
is used (is it in a large JSON file?).
The short term workaround is to use find in files filters to reduce the scope/exclude certain files from search:
https://twitter.com/dejohn_paul/status/1523696485254451202
@yaustar This is using the search for all files in the project, so I'm not sure which of them is causing the issue. There are JSON files, glb models, textures, code etc... But the problem only started recently after adding more models to the project. Maybe that's what's causing the issue?
Never mind, GLB files aren't searchable in the editor. I tried your suggestion and filtered by file type. Large (~7MB, ~9MB and ~14MB) JSON files were causing the issue, but its still weird that searching those files were causing a memory usage of +16GB
It's definitely something we should investigate, hopefully the find in files will mitigate it a bit in the meantime 🤞
@slimbuck Would this be fixed by your changes that made find in files much faster?
Possibly. Worth checking.
Assumed fixed with slimbuck's changes to faster search