Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » httpRequests in secondary non-gui-main Thread (if memory leaks come from http.buffer?)
Re: httpRequests in secondary non-gui-main Thread [message #55374 is a reply to message #55367] Tue, 03 November 2020 13:40 Go to previous messageGo to previous message
JeyCi is currently offline  JeyCi
Messages: 50
Registered: July 2020
Member
mirek wrote on Tue, 03 November 2020 09:08
The best way is (after it stops on memory breakpoint) Debug / Copy backtrace of all threads.

? what do you mean "backtrace" - is it this dropdown
index.php?t=getfile&id=6273&private=0[
mirek wrote on Tue, 03 November 2020 09:08
Any chance you are doing something like early exit from the thread?

seems not - I'm simplifying testing case Smile
mirek wrote on Tue, 03 November 2020 09:08

Ah, and maybe the most important: Are you using Upp::Thread? Or are how do you start the thread?

member Thread work; - in class MyAppWindow : public WithMyAppWindowLayout<TopWindow> starting work from here:
void MyAppWindow:: btnStart_Click()
{
    work.Run ( [=]{ WorkerThread(); } );
}

I thought that native for U++ Thread is OK & I do not need creating my own wrapper_class for executing my thread - I like opportunities U++ gives with its Thread class... or do you think I'd better create my separate wrapper_class to work with Thread?.. something like RAII-style... though I don't need any special ways of synchronization - am just using THISFN for interaction with Gui, using GuiLock/Call in these functions...
===
So, here:
		    MemoryIgnoreLeaksBegin() ;
		    w.http.Do(); 
		    MemoryIgnoreLeaksEnd();

- with thus it is OK when being executed Workerthread() function...
or do you think it is better to create a separate class to wrap the Thread?..
===
BTW the situation still differs depending on chosen compiler - as I have written - with MINGW_built_in_U++ - OK working... but with my newer mingw_9_3 in Build Method I do have leak in the place I've shown in the code (switching-on MemoryIgnore in that line - function works good)...
because I deleted everything in BuildMethod from U++ but made settings (path, include, lib) only for foreign mingw (loaded with msys2) - perhaps I have lost something important in my settings (when removed native stuff)?
though in msys2 I have even done separate installation additionally to mingw itself:
Installation:pacman -S openssl

===
oh, mirek - I think I can suppose the reason - msys2 is also no more supporting x32 from May 2020... you was right - most modern CPUs support the possibility to increase RAM-size... really...
Anyway it seems I now do know how to find memory_leak in U++ - no other foreign tools needed -- Thank you...
and the testing code still works without memory-leaks in U++-v.13664 - the version in which mingw already build_in
  • Attachment: 03.11_2.jpg
    (Size: 181.64KB, Downloaded 575 times)


Best regards.

[Updated on: Tue, 03 November 2020 13:51]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Encoding URL for HttpRequest
Next Topic: Missing data in the socket
Goto Forum:
  


Current Time: Mon Apr 29 06:58:30 CEST 2024

Total time taken to generate the page: 0.03634 seconds