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

critical memory leak #10

Open
yiwiz-sai opened this issue Oct 22, 2021 · 9 comments
Open

critical memory leak #10

yiwiz-sai opened this issue Oct 22, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@yiwiz-sai
Copy link

const boa = require('@pipcook/boa');
const { bytes } = boa.builtins();
async function sleep(ms){
        const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
        await delay(ms);
}
async function test(){
        while(1){
                let buf = Buffer.from('f'.repeat(10000000));
                aa = bytes.fromhex(buf.toString('hex'));
                await sleep(1000);
                console.log(aa.slice(0,10));
        }
}
test();

run it in docker, and run "docker stats" to watch the memory.

@FeelyChau FeelyChau added the bug Something isn't working label Oct 25, 2021
@yiwiz-sai
Copy link
Author

@FeelyChau only want to know if this critical issue will be fixed soon. I am not pushing, but I have a project to use this library, if it need long time to fix. I have to change to other way.
Appreciate if you can let me know.

@FeelyChau
Copy link
Contributor

@yiwiz-sai #12 Should fix it, but we still have some problems with testing that need to be fixed. But you could build it from this branch manually.

@yiwiz-sai
Copy link
Author

thanks @FeelyChau ! I think this is a very critical bug, so once you finish the fix, will you release a new version to npmjs quickly?

@yiwiz-sai
Copy link
Author

yiwiz-sai commented Nov 9, 2021

@FeelyChau I built and tested, it failed when I import any 3rd party python library

TypeError: ModuleNotFoundError: No module named 'numpy'

At:
  ./detector.py(6): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load

I know that commit failed to pass some tests, as you mentioned.

I think the reason is it has some bugs about module import

@rickycao-qy
Copy link

@FeelyChau I built and tested, it failed when I import any 3rd party python library

TypeError: ModuleNotFoundError: No module named 'numpy'

At:
  ./detector.py(6): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load

I know that commit failed to pass some tests, as you mentioned.

I think the reason is it has some bugs about module import

For this one, this is because you will need to use ./tools/bip install numpy to install libraries first. After all, it indeed has some bugs for some kind of import now. We are trying to fix it.

@yiwiz-sai
Copy link
Author

@FeelyChau I built and tested, it failed when I import any 3rd party python library

TypeError: ModuleNotFoundError: No module named 'numpy'

At:
  ./detector.py(6): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load

I know that commit failed to pass some tests, as you mentioned.
I think the reason is it has some bugs about module import

For this one, this is because you will need to use ./tools/bip install numpy to install libraries first. After all, it indeed has some bugs for some kind of import now. We are trying to fix it.

thanks @rickycao-qy, it works !

@mattseddon
Copy link

Would someone be able to approve the workflow run for #15 to see if it fixes the issues with the tests?

Please and thank you.

@mattseddon
Copy link

#15 should close this now and maybe #14 too.

@yiwiz-sai
Copy link
Author

yiwiz-sai commented Feb 17, 2022

@rickycao-qy bip can not install python c-extension package,
for example

success for common package
node_modules/.bin/bip  install redis

failed for c extension package  (miss Python.h)
node_modules/.bin/bip  install quickjs

hmm, seems ./bin/bip need miniconda, but I can not find miniconda in memory-leak branch

I have to use tools/bip.js to install quickjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants