From: james a. <ja...@dy...> - 2012-02-22 21:39:09
|
good evening, all; it appears, that memory which is allocated under "multi-threaded" circumstances is not reliably released. once a thread which has allocated the memory has been destroyed and no reference to the thread remains, the memory is released. the attached file contains code which demonstrates the problem in 1.0.55. the effect was observed whether the new thread performed the (fill-q) and the initial thread the (drain-q) or the roles reversed. the effect was not observed if the initial thread performed both the (fill-q) and (drain-q) similar behavior was observed in 1.0.45, and 1.0.50 best regards, from berlin ------- ;;; initialize the queue pointers * (clear-q) (NIL) ;;; start a thread which fills the queue. drain it in the initial thread * (setq *thread* (run-q-from-new)) #<SB-THREAD:THREAD RUNNING {1005219943}> * *thread* #<SB-THREAD:THREAD RUNNING {1005219943}> * (room) Dynamic space usage is: 150,814,688 bytes. Read-only space usage is: 6,736 bytes. Static space usage is: 4,000 bytes. Control stack usage is: 2,976 bytes. Binding stack usage is: 800 bytes. Control and binding stack usage is for the current thread only. Garbage collection is currently enabled. Breakdown for dynamic space: 100,704,576 bytes for 4,116 simple-array-fixnum objects. 13,707,568 bytes for 12,937 code objects. 9,162,896 bytes for 105,311 instance objects. 8,030,272 bytes for 501,892 cons objects. 7,937,360 bytes for 69,755 simple-vector objects. 11,278,800 bytes for 273,371 other objects. 150,821,472 bytes for 967,382 dynamic objects (space total.) * (dotimes (x 5) (sb-ext:gc :full t)) NIL * *queue-header* (NIL) * *queue-pointer* (NIL) * (room) Dynamic space usage is: 146,937,264 bytes. Read-only space usage is: 6,736 bytes. Static space usage is: 4,000 bytes. Control stack usage is: 2,976 bytes. Binding stack usage is: 800 bytes. Control and binding stack usage is for the current thread only. Garbage collection is currently enabled. Breakdown for dynamic space: 100,728,976 bytes for 4,105 simple-array-fixnum objects. 13,707,808 bytes for 12,938 code objects. 8,006,224 bytes for 92,816 instance objects. 7,690,320 bytes for 480,645 cons objects. 7,427,808 bytes for 63,064 simple-vector objects. 9,376,128 bytes for 164,654 other objects. 146,937,264 bytes for 818,222 dynamic objects (space total.) * ;;; terminate, then release the thread instance. the array memory is not released until the thread instance has been * (sb-thread:signal-semaphore *thread-semaphore*) 1 * *thread* #<SB-THREAD:THREAD FINISHED values: T {1005219943}> * (room) Dynamic space usage is: 146,970,048 bytes. Read-only space usage is: 6,736 bytes. Static space usage is: 4,000 bytes. Control stack usage is: 2,976 bytes. Binding stack usage is: 800 bytes. Control and binding stack usage is for the current thread only. Garbage collection is currently enabled. Breakdown for dynamic space: 100,728,976 bytes for 4,105 simple-array-fixnum objects. 13,707,808 bytes for 12,938 code objects. 8,019,632 bytes for 92,950 instance objects. 7,702,848 bytes for 481,428 cons objects. 7,437,936 bytes for 63,070 simple-vector objects. 9,405,280 bytes for 165,135 other objects. 147,002,480 bytes for 819,626 dynamic objects (space total.) * (sb-ext:gc :full t) NIL * (room) Dynamic space usage is: 146,811,104 bytes. Read-only space usage is: 6,736 bytes. Static space usage is: 4,000 bytes. Control stack usage is: 2,976 bytes. Binding stack usage is: 800 bytes. Control and binding stack usage is for the current thread only. Garbage collection is currently enabled. Breakdown for dynamic space: 100,728,976 bytes for 4,105 simple-array-fixnum objects. 13,707,568 bytes for 12,937 code objects. 7,954,768 bytes for 92,274 instance objects. 7,679,664 bytes for 479,979 cons objects. 7,411,088 bytes for 62,904 simple-vector objects. 9,329,040 bytes for 163,018 other objects. 146,811,104 bytes for 815,217 dynamic objects (space total.) * (setq *thread* nil) NIL * (sb-ext:gc :full t) NIL * (room) Dynamic space usage is: 45,657,408 bytes. Read-only space usage is: 6,736 bytes. Static space usage is: 4,000 bytes. Control stack usage is: 2,976 bytes. Binding stack usage is: 800 bytes. Control and binding stack usage is for the current thread only. Garbage collection is currently enabled. Breakdown for dynamic space: 13,707,568 bytes for 12,937 code objects. 7,952,960 bytes for 92,252 instance objects. 7,606,944 bytes for 475,434 cons objects. 7,411,344 bytes for 62,903 simple-vector objects. 2,348,544 bytes for 36,696 symbol objects. 6,630,048 bytes for 121,303 other objects. 45,657,408 bytes for 801,525 dynamic objects (space total.) * |