Comments (7)
Note :
I have tested adding -D OATPP_DISABLE_POOL_ALLOCATIONS.
* Define this to disable memory-pool allocations.
* This will make oatpp::base::memory::MemoryPool, method obtain and free call new and delete directly
I see no change to the memory behaviour
Thanks
Conor
from oatpp.
Hello @cgrantcal,
OATPP_DISABLE_POOL_ALLOCATIONS
is the right guess.
Note that you have to rebuild oatpp
module liboatpp
in order for this to work.
Please let me know how is your progress.
Regards,
Leonid
from oatpp.
@cgrantcal
Update.
I've added a fix for disabling pool allocations. See #49.
Also I made it possible to configure oatpp compiler options from cmake.
So to build oatpp with OATPP_DISABLE_POOL_ALLOCATIONS
:
(from oatpp dir)
$ cd build/
$ cmake -DOATPP_DISABLE_POOL_ALLOCATIONS=ON ..
$ make
$ make install
To make sure that oatpp is built with the right options you may add a log oatpp::base::Environment::printCompilationConfig();
So now it should deallocate more memory once load is dropped and connections are closed.
Please let me know if you have more questions.
Best Regards,
Leonid
from oatpp.
Hey,
I can see that with that flag enabled:
############################################################################
## oatpp module compilation config:
OATPP_DISABLE_ENV_OBJECT_COUNTERS=OFF
OATPP_DISABLE_POOL_ALLOCATIONS=ON
OATPP_THREAD_HARDWARE_CONCURRENCY=AUTO
OATPP_THREAD_DISTRIBUTED_MEM_POOL_SHARDS_COUNT=10
OATPP_ASYNC_EXECUTOR_THREAD_NUM_DEFAULT=2
I can still see that the memory usage never decreases
In your tests how long does it take before the memory is de allocated?
Thanks
Conor
from oatpp.
Hey @cgrantcal ,
Looks like not all pools are disabled. I think it might be a bug.
Can you please specify what load you are running against your service:
- type of request
- concurrency level
- requests per second
Thanks,
Leonid
from oatpp.
Hey,
I am making simple post and get requests.
There are about 5 clients hooked up. making about 100 requests a second each for 10 seconds.
Hope that helps.
Thanks
Conor
from oatpp.
Hey @cgrantcal ,
I've conducted some tests and results are as follows:
Currently the best results in terms of memory you are able to get with oatpp being built as:
cmake -DOATPP_DISABLE_POOL_ALLOCATIONS=ON -DOATPP_THREAD_DISTRIBUTED_MEM_POOL_SHARDS_COUNT=1 -DCMAKE_BUILD_TYPE=Release ..
In this setup I get:
- 352 KB on service start.
- 13.2 MB during the load
wrk -t1 -c500 -d10s "http://127.0.0.1:8000/"
- 5.4 MB when load is dropped
Also memory consumption will grow a bit as the load repeated till some point (due to memory fragmentation).
I'll try to make some memory optimization in future, but for now it is what it is
Best Regards,
Leonid
from oatpp.
Related Issues (20)
- Memory leak on windows with statically linked openssl
- Is my addition to example to correct HOT 3
- Build errors HOT 3
- Access route object in endpoint for dynamic usage HOT 1
- Ask for IOEventWorker on the windows platform HOT 6
- Digest Authorization
- How to catch this exception HOT 4
- API question - Enum to string HOT 2
- Build failure because of `-fcf-protection` (again) HOT 5
- Warning array-bounds CommunicationError.cpp
- ASYNC API and business logic (Question) HOT 1
- How to build oatpp on arm64? HOT 4
- About MySQL
- BODY_DTO fails to correctly parse "false" for Boolean HOT 1
- Sending "null" in request body causes seg-fault on any endpoint w/ BODY_DTO
- Can files be read asynchronously in ENDPOINT_ASYNC? HOT 1
- Regarding oatpp::async::CoroutineWithResult HOT 9
- How to add default values to the QUERY parameters of an ENDPOINT?
- Enhance Deserializer's "Error. Unknown field"
- How can I use OATPP to handle web browser request download file. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oatpp.