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

Verify the behaviour of a sandboxed processor in case of a given contract is using too much memory #2

Open
ppedziwiatr opened this issue Nov 30, 2022 · 1 comment
Assignees

Comments

@ppedziwiatr
Copy link
Contributor

ppedziwiatr commented Nov 30, 2022

prepare a worker that will execute code similar to:

const storage = [];
const twoMegabytes = 1024 * 1024 * 2;
	
while (true) {
	const array = new Uint8Array(twoMegabytes);
	for (let ii = 0; ii < twoMegabytes; ii += 4096) {
		array[ii] = 1; // we have to put something in the array to flush to real memory
	}
	storage.push(array);
	console.log('Wasted '+ (storage.length * 2)+ 'MB');
}

- and see what will happen :-)

@ppedziwiatr
Copy link
Contributor Author

For reference - taskforcesh/bullmq#1555

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

No branches or pull requests

2 participants