Solved TD-22667: Memory leaks in SalStrToMultiByte/SalStrToWideChar

Post found bugs and possible workarounds.
Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 280
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

TD-22667: Memory leaks in SalStrToMultiByte/SalStrToWideChar

Post by Dave Rabelink » 13 Mar 2017, 08:23

The functions

SalStrToMultiByte
SalStrToWideChar

show memory leaks when used.
A simple conversion from ANSI to UNICODE or back shows that the memory steadily increases on every call.

Memleak_Graph.png

After investigation here we found that the leaks are introduced in TD 6.2 and are present in all TD 6.2 SP's and also in TD 6.3 (all SP's).
Tests on TD 5.1 and TD 6.1 show no leaks on the same testcase.

The testcase is saved in TD 5.1 format (text) to be able to run the sample in all unicode TD versions.

Workflow:

- run application (from IDE or from EXE)
- monitor the memory using PerfMon (private bytes, workset private) for the application
- Press the START button. This will execute these functions multiple times.
- See the memory increase and never released. It increases with megabytes within minutes.
- Press STOP to end the testing

Use the checkboxes to test the functions separately or both or none.

StrConversion_MemLeak.zip
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 280
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TD-22667: Memory leaks in SalStrToMultiByte/SalStrToWideChar

Post by Dave Rabelink » 13 Mar 2017, 08:24

This defect is fixed in:

TD 6.2 SP5
TD 6.3 SP1 UPDATE 2
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Return to “Bug Reports”

Who is online

Users browsing this forum: Ccbot [Crawler] and 0 guests