You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This heapened when I use Google Chrome . When I load a big model (1GB) using the following code ,it uses a lot of memory <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> </body> <script type="module"> import { OBJLoader2 } from "./jsm/loaders/OBJLoader2.js"; ( function () { let objLoader2 = new OBJLoader2(); let callbackOnLoad = function ( object3d ) { console.log("success"); }; objLoader2.setModelName( "modelName" ); objLoader2.load( 'test_model/test2.obj', callbackOnLoad, null, null, null ); } )(); </script> </html> The garbage collection should clear the memory which stores the model , but it didn't do that,is
it memory leak?.
When I load using the following code,just add more line " delete objLoader2.parser.contentRef;" in callbackOnLoad function <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> </body> <script type="module"> import { OBJLoader2 } from "./jsm/loaders/OBJLoader2.js"; ( function () { let objLoader2 = new OBJLoader2(); let callbackOnLoad = function ( object3d ) { delete objLoader2.parser.contentRef; console.log("success"); }; objLoader2.setModelName( "modelName" ); objLoader2.load( 'test_model/test2.obj', callbackOnLoad, null, null, null ); } )(); </script> </html> the memory which stores the model will be clear;
The text was updated successfully, but these errors were encountered:
@Cobertos Thank you for providing the connection to the other issue. I was not aware of this. @DengCun I am hesitant to put the delete statement inside the parse function as this is solely a Chrome issue. Are you ok with the workaround you found?
This heapened when I use Google Chrome .
When I load a big model (1GB) using the following code ,it uses a lot of memory
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
<script type="module">
import { OBJLoader2 } from "./jsm/loaders/OBJLoader2.js";
( function () {
let objLoader2 = new OBJLoader2();
let callbackOnLoad = function ( object3d ) {
console.log("success");
};
objLoader2.setModelName( "modelName" );
objLoader2.load( 'test_model/test2.obj', callbackOnLoad, null, null, null );
} )();
</script>
</html>
The garbage collection should clear the memory which stores the model , but it didn't do that,is
it memory leak?.
When I load using the following code,just add more line "
delete objLoader2.parser.contentRef;
" incallbackOnLoad
function<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
<script type="module">
import { OBJLoader2 } from "./jsm/loaders/OBJLoader2.js";
( function () {
let objLoader2 = new OBJLoader2();
let callbackOnLoad = function ( object3d ) {
delete objLoader2.parser.contentRef;
console.log("success");
};
objLoader2.setModelName( "modelName" );
objLoader2.load( 'test_model/test2.obj', callbackOnLoad, null, null, null );
} )();
</script>
</html>
the memory which stores the model will be clear;
The text was updated successfully, but these errors were encountered: