david.april
asked on
Memory Leak Problem with Borland 5.0.1 Multithread Libraries!
Hi there -
I have a memory leak problem with an HTTP server application that is written using Borland C++ 5.0.1. It runs fine when compiled as a single threaded app.
The memory leak shows up when the app is compiled with the
multi-threading option enabled even though there are no other threads being explicitly created.
We can reproduce the error with the following 12 lines of code:
// -------- Begin test code --------
// Test for memory leak with Borland 5.0.1 and Windows NT4.0 SP2
// Compile this without the multithread option and everything is fine.
// Compile with the multithread option (under TargetExpert),
// and it leaks memory rather quickly.
#pragma hdrstop
#include <vector>
#include <string>
main() {
while(true) {
std::vector<std::string> vect;
for (int i = 0; i != 10; i++) {
vect.push_back("Quack");
};
};
};
// -------- End test code --------
I have a memory leak problem with an HTTP server application that is written using Borland C++ 5.0.1. It runs fine when compiled as a single threaded app.
The memory leak shows up when the app is compiled with the
multi-threading option enabled even though there are no other threads being explicitly created.
We can reproduce the error with the following 12 lines of code:
// -------- Begin test code --------
// Test for memory leak with Borland 5.0.1 and Windows NT4.0 SP2
// Compile this without the multithread option and everything is fine.
// Compile with the multithread option (under TargetExpert),
// and it leaks memory rather quickly.
#pragma hdrstop
#include <vector>
#include <string>
main() {
while(true) {
std::vector<std::string> vect;
for (int i = 0; i != 10; i++) {
vect.push_back("Quack");
};
};
};
// -------- End test code --------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
http://www.ipmce.su/people/fbp/stl/stlport.html) and am trying to see if it makes a difference.
FWIW, Borland has indicated that this problem is not fixed in BC5.2, but a tech there is also looking at their STL source to dig into it more.
Dave