Giter Club home page Giter Club logo

Comments (5)

peter-rs avatar peter-rs commented on July 17, 2024

From the error message shown, this does not look to be a pyrx problem. Please either show a more specific error message that points to pyrx as the root cause of this issue.

from pyrx.

TungKaiYing avatar TungKaiYing commented on July 17, 2024

I've identified the error, the process are killed by oom killer because the
system run out of memory during pyrx initialization ! Here the logs :

[37775.066200] python3 invoked oom-killer:
gfp_mask=0x100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), order=0, oom_score_adj=0
[37775.066479]
oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-0.slice/session-29.scope,task=python3,pid=15079,uid=0
[37775.066533] Out of memory: Killed process 15079 (python3)
total-vm:2639560kB,anon-rss:624304kB, file-rss:4kB, shmem-rss:8kB, UID:0
pgtables:1336kB oom_score_adj:0

Any suggestion to only initialize pyrx one time for two process or maybe to
reduce memory usage of it ?

from pyrx.

TungKaiYing avatar TungKaiYing commented on July 17, 2024

I've solved the issue by measuring the available free memory and divid it by the number of cpu cores then i define the maximum usage of memory per process with this function :

`def initializer(self):
gc.collect()

    free_memory = 0

    with open('/proc/meminfo', 'r') as mem:
        for i in mem:
            sline = i.split()
            if str(sline[0]) in ('MemFree:', 'Buffers:', 'Cached:'):
                free_memory += int(sline[1])

    soft, hard = resource.getrlimit(resource.RLIMIT_AS)
    resource.setrlimit(resource.RLIMIT_AS, (int(free_memory * 1024 / 2), hard))`

Unfortunetly it lead to not being able to use large page i don't know why i've tried to add this :

os.system("sysctl -w vm.nr_hugepages=1280")

inside the initializer without success maybe it should not be 1280 but another value because of the number of process ?

Edit :

Pyrx is in fact initialized two times because there is two cores on the processor and Processpoolexecutor start two process. How to initialize only one time pyrx ? thanks

from pyrx.

TungKaiYing avatar TungKaiYing commented on July 17, 2024

Nobody have the solution to initialize pyrx one time and use it in two different process ? I mean with the same dataset ? Process can help to gain some power compare to thread thats why im trying this way. Im still stuck there.

from pyrx.

jtgrassie avatar jtgrassie commented on July 17, 2024

This is not a support forum, it's a bug tracker, and this is not a bug.

from pyrx.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.