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)
- How can I use OATPP to handle web browser request download file. HOT 2
- Memory leak in Object mapping HOT 1
- Deserialize json when not include required field only gives error when the field is specified as null
- [Question] readBodyIntoDTO when there's a list in the body
- API question
- how to make dynamic sql use oatpp-sqlite HOT 1
- LazyStringMapTemplate::get returns Nullptr wich is not in oatpp.io Documentation
- Please add support for CMake 3.16
- Cannot test if required integer query parameter is empty
- [Question] Is it possible during compilation to write out the generated oas-3.0.0.json file?
- May memory leak
- How should I make my process send requests to the target when using OATPP HOT 4
- Stack corruption issue in ConnectionProvider.cpp
- Can not build project successfully
- Is it possible make oatpp::network::tcp::client::ConnectionProvider support bind client IP?
- specific async pattern implementation query HOT 4
- io_uring support request HOT 1
- Compilation error on Windows with MinGW
- Facing linker issue (undefined reference to `oatpp::base::Environment::getComponent) in windows using mingw gcc compiler
- auto objectMapper = oatpp::json::ObjectMapper::createShared(); 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.