Commit e777cb4
committed
aio-stress: fix memory leak
setup_shared_mem() currently runs as part of run() function,
and if it runs for too many iterations it can consume so much
memory that OOM kills it.
Move setup_shared_mem() along with the 2 checks for io_iter and
num_threads to setup(). This way it runs only once and gets
freed on test exit.
As consequence setup_ious() also needs to be modified to no longer
modify global variable 'aligned_buffer', because we don't re-initialize
it on every iteration.
And finally, at the end of run() function free also memory allocated
by setup_ious().
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Li Wang <liwang@redhat.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Andrea Cervesato <andrea.cervesato@suse.com>1 parent a92aedf commit e777cb4
1 file changed
+27
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
| 917 | + | |
917 | 918 | | |
918 | 919 | | |
919 | 920 | | |
920 | 921 | | |
921 | 922 | | |
922 | 923 | | |
923 | | - | |
924 | | - | |
| 924 | + | |
| 925 | + | |
925 | 926 | | |
926 | 927 | | |
927 | 928 | | |
| |||
932 | 933 | | |
933 | 934 | | |
934 | 935 | | |
935 | | - | |
| 936 | + | |
936 | 937 | | |
937 | 938 | | |
938 | 939 | | |
| |||
1228 | 1229 | | |
1229 | 1230 | | |
1230 | 1231 | | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | 1232 | | |
1245 | 1233 | | |
1246 | 1234 | | |
| |||
1256 | 1244 | | |
1257 | 1245 | | |
1258 | 1246 | | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1259 | 1263 | | |
1260 | 1264 | | |
1261 | 1265 | | |
| |||
1322 | 1326 | | |
1323 | 1327 | | |
1324 | 1328 | | |
1325 | | - | |
1326 | | - | |
1327 | 1329 | | |
1328 | 1330 | | |
1329 | 1331 | | |
| |||
1339 | 1341 | | |
1340 | 1342 | | |
1341 | 1343 | | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
1342 | 1351 | | |
1343 | 1352 | | |
1344 | 1353 | | |
| |||
0 commit comments