Bug #3361
opennewlocale()/freelocale() leak
0%
Description
The attached code shows the combination of newlocale() to create a new locale object and freelocale() to free that object leaks memory.$ ./newlocale_loop
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
1001 825 822 4 178 0 4124 680 wait S0+ 0 0:00.00 ./n
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
1001 825 822 80 254 0 7.63G 416616 wait S1+ 0 0:05.37 ./n
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
1001 825 822 80 254 0 15.26G 832272 wait S1+ 0 0:09.62 ./n
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
1001 825 822 80 254 0 22.89G 1.19G wait S1+ 0 0:12.80 ./n
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
1001 825 822 80 254 0 30.52G 1.58G wait S1+ 0 0:17.34 ./n
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
1001 825 822 80 254 0 38.15G 1.98G wait S1+ 0 0:18.68 ./n
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
1001 825 822 80 254 0 45.78G 2.37G wait S1+ 0 0:23.65 ./n
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
1001 825 822 80 254 0 53.41G 2.77G wait S1+ 0 0:26.65 ./n
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
1001 825 822 80 254 0 61.04G 3.17G wait S1+ 0 0:30.35 ./n
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
1001 825 822 80 254 0 68.67G 3.56G wait S1+ 0 0:35.02 ./n
Note RSS going from 680 to 3.56G
Building and running the same code on Linux (Debian bookworm) and Freebsd 15-CURRENT does not leak in the same way.
Files
No data to display