-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(playgrounds): handle out of memory playground worker VSCODE-269 (#…
…459)
- Loading branch information
Showing
5 changed files
with
106 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* This playground is used to test how the language server worker | ||
* handles an out of memory error in mongosh's running of a playground. VSCODE-269 | ||
*/ | ||
|
||
use('test'); | ||
|
||
const mockDataArray = []; | ||
for(let i = 0; i < 50000; i++) { | ||
mockDataArray.push(Math.random() * 10000); | ||
} | ||
|
||
const docs = []; | ||
for(let i = 0; i < 10000000; i++) { | ||
docs.push({ | ||
mockData: [...mockDataArray], | ||
a: 'test 123', | ||
b: Math.ceil(Math.random() * 10000) | ||
}); | ||
} | ||
|
||
console.log('Should not show this message as the process should have run out of memory in the loop above.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters