Comments (4)
sizeof(communicator)
gives 8. So there's actually some memory leaking going on. With --leak-check=full
, I find:
==45885== HEAP SUMMARY:
==45885== in use at exit: 278,165 bytes in 2,329 blocks
==45885== total heap usage: 6,583 allocs, 4,254 frees, 2,483,386 bytes allocated
==45885==
==45885== 14 bytes in 1 blocks are definitely lost in loss record 139 of 1,927
==45885== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==45885== by 0x4935738: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.4)
==45885== by 0x494A583: g_strdup (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.4)
==45885== by 0x4A8581C: g_inet_address_to_string (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7200.4)
==45885== by 0x10C70E: uca_phantom_communicate_discover (uca-phantom-communicate.c:456)
==45885== by 0x10C70E: uca_phantom_communicate_attempt_connect (uca-phantom-communicate.c:565)
==45885== by 0x10B982: main (test_network.c:37)
So a malloc isn't being free'd before I ctrl+c.
from uca-phantom.
So actually I introduced the memroy leak by letting github copilot malloc something while forgetting to free it... Darn AI.
That being said, the main issue persists.
from uca-phantom.
Probable cause
I might simply be overwhelming the IO capacity of the phantom camera (or the PC ? seems unlikely).
This would explain why the only solution to the problem is adding some waiting time between each call.
Solutions:
- throttling of data stream (i.e. reduce the frequency)
- use async methods
- write_all_async
- or even buffering (new_thread + queue)
from uca-phantom.
Issue was fixed in cad4a3c: was caused by some trailing carriage return
from uca-phantom.
Related Issues (12)
- Frame rate not settable HOT 1
- Use libpcap for 10Gb data transfer ? HOT 1
- Add levels of verbosity in phantom logs/warnings/messages
- Handle phantom specific features
- Add timestamps HOT 1
- Declutter uca-phantom by seperating phantom networking functions from actual camera class implementation HOT 3
- Envision implementing unit tests for the phantom camera
- Modernizing uca-phantom to latest GObject standards and practices
- Automatic documentation generation HOT 1
- Start using `g_autoptr` and `g_autofree` in all GLib based code ? (libuca, etc)
- Nested error management
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 uca-phantom.