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 #55367 is a reply to message #55366] Tue, 03 November 2020 09:08 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
JeyCi wrote on Tue, 03 November 2020 08:07
Klugier wrote on Sat, 31 October 2020 15:02
It will show you exactly in which place the leak is.

thank you all for your replies! - I've got the place where it leaks:
it leaks here when httpRequests are being done in secondary thread (not gui-thread) - when using --memory-breakpoint__ [num detected before] - myApp stops here in debug
index.php?t=getfile&id=6272&private=0
? can it be connected with OpenSSL, perhaps, as external library is considered to be?
or just the problem of my app_design?..
perhaps, declaring Vector <urls> as thread-local prior to start of thread can help?..
but frankly speaking I intend to consider the error arising just because of switching-context that takes place in MT-environment & not freeing http.buffer... though I added w.http.ClearContent(); in the code...
or perhaps really http.buffer for each request should have thread-local storage-duration?...
p.s.
(btw I'm gathering the Vector of links in the same secondary thread - not transferring it from main thread)
Anyway, thank you, - now I see exact place where it happens


The interesting info you should have sent is the backtrace. The best way is (after it stops on memory breakpoint) Debug / Copy backtrace of all threads.

HttpRequest should not leak (of course, it is always possible there is a bug). Any chance you are doing something like early exit from the thread?

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

Mirek

[Updated on: Tue, 03 November 2020 09:09]

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:53:35 CEST 2024

Total time taken to generate the page: 0.02782 seconds