Render BEMHTML templates using PyV8.
'www' based on code from https://github.com/bem/bem-bl-test.git
Render BEMJSON with python and PyV8
Render BEMHTML templates using PyV8.
'www' based on code from https://github.com/bem/bem-bl-test.git
Hi, this is more PyV8 issue, but I want to know your experience.
After rendering js file (about 300kb) and exiting context, PyV8 doesn't free memory. This is code demonstration.
import os, gc
import PyV8
def get_mem():
a = os.popen('ps -p %d -o %s | tail -1' % (os.getpid(),"vsize,rss,pcpu")).read()
a = a.split()
return (int(a[0]), int(a[1]))
def main():
js_code = open('bem/touch.bundles/rubric/rubric.xml.js', 'r').read().decode('utf-8')
for i in xrange(10**5):
with PyV8.JSContext() as ctx:
ctx.eval(js_code)
if i % 10000:
PyV8.JSEngine.collect()
gc.collect()
print get_mem()
if __name__ == "__main__":
main()
Output:
(744060, 20432)
(745880, 21792)
(746904, 22268)
(746904, 22572)
...
(2176496, 1061752)
(2176496, 1062116)
Traceback (most recent call last):
File "v8test.py", line 22, in <module>
main()
File "v8test.py", line 15, in main
ctx.eval(js_code)
PyV8.JSError: JSError: <CALL_AND_RETRY_LAST> Allocation failed - process out of memory
Do you use python-bem in production?
Do you have such problem?
Does PyV8 leak with django object?
Which version of PyV8, V8 do you use?
Thank you in advance for any help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.