Skip to content

Cannot Enlarge Memory Error #3

@tridelt

Description

@tridelt

Dear @av-virlan

if I call the predict() around 350.000x with k=151 like in this code snippet:

const runApp = function() {
	initFastText().then(function(){
		document.querySelector("#fasttext-loading").style.display = "none";
		document.querySelector("#try-it-out").style.display = "block";
		document.querySelector("#detect").addEventListener("click", function(){
			const inputText = document.querySelector("#inputText").value;
			for (let i = 0; i < 10000000; i++) {
					
				window.fastTextModel.predict(inputText,k=151);
				if (i%50000===0) {
					console.log(i)
				}
			}
		document.querySelector("#detectedLanguage").innerHTML = "Detected language: " + predictions[0].label.substring("__label__".length);
		});
	});
}

It runs out of memory and throws this error:

Cannot enlarge memory, asked to go up to 2147487744 bytes, but the limit is 2147483648 bytes!

Is there a memory leak?

Would be super happy to hear your opinion.

Yours
Tridelt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions