tbodt / v8py

Write Python APIs, then call them from JavaScript using the V8 engine.
GNU Lesser General Public License v3.0
440 stars 28 forks source link

Add method to trigger low memory notification #36

Closed byronpatrick22 closed 4 years ago

byronpatrick22 commented 4 years ago

Force v8 garbage collection in context object deallocation

tbodt commented 4 years ago

I don't think this is a good idea since "low on memory" is a lie. Most programs should let V8 collect its garbage when it wants. If your program is different, we can add a low memory notification method to v8py, but it shouldn't be called on every context destroy.

tbodt commented 4 years ago

Seems good but I don't think this should have a test. "Low memory" is a hint, not a requirement that something should happen.

codecov-io commented 4 years ago

Codecov Report

Merging #36 into master will decrease coverage by 0.16%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
- Coverage   81.05%   80.88%   -0.17%     
==========================================
  Files          16       16              
  Lines        1346     1350       +4     
==========================================
+ Hits         1091     1092       +1     
- Misses        255      258       +3
Impacted Files Coverage Δ
v8py/v8py.cpp 86.66% <0%> (-2.99%) :arrow_down:
v8py/pyclass.cpp 96.29% <0%> (+0.61%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3882612...4f98187. Read the comment docs.