Skip to content

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

@ppedziwiatr

Description

@ppedziwiatr

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 :-)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions