crossbario / crossbario/autobahn-python
High Memory Consumption on Barebone WAMP Component
Open
Nobody has claimed this yet.
docs
enhancement
wamp
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 768
- PR merge metrics
- No merged PRs in 30d
Description
Using memory_profile I verified that a empty barebone WAMP component has a high memory consumption. Bellow the examples for Twisted and Asyncio with Cpython3, and Pypy3
Twisted code:
from os import environ
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
class MyComponent(ApplicationSession):
def onJoin(self, details):
print("joined")
pass
if __name__ == '__main__':
runner = ApplicationRunner(url=u"ws://localhost:8888/ws",
realm=u"RE_acct")
runner.run(MyComponent, auto_reconnect=False)
Python3
~35Mb of RAM
PyPy3
~85Mb of RAM
Asyncio:
from os import environ
import asyncio
from autobahn.asyncio.wamp import ApplicationSession, ApplicationRunner
class MyComponent(ApplicationSession):
def onJoin(self, details):
print("joined")
pass
if __name__ == '__main__':
runner = ApplicationRunner(url=u"ws://localhost:8888/ws",
realm=u"RE_acct")
runner.run(MyComponent)
Python3
~18Mb of RAM
PyPy3
~75Mb of RAM
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported memory usage with the Twisted and asyncio ApplicationRunner examples, comparing CPython 3 and PyPy 3. Trace the ApplicationSession and runner startup paths to identify where the empty component's memory is allocated. Done means the cause is established and the reported baseline consumption is reduced or clearly documented as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100