RE: [Tcl-nap-users] Nap Memory Problem
Brought to you by:
dav480,
peter_turner
From: <Pau...@cs...> - 2006-03-04 02:12:13
|
Salah, I think your problem is linked to the instance of wish.exe still = persisting in memory. Memory is allocated to a process, and only after = the process is terminated is this memory allocation freed back to the = system. So in the instance you are describing below, NAP is = appropriately dealing with the memory within its operation (as a wish = process), however wish.exe keeps a handle to this memory until it is = termination - it's just one of the memory quirks within computing. A way around this kind of memory bloat is to call instances of wish (or = tclsh) within a shell script (or alternate), these instances then are = allocated memory and freed within a looping structure, and your memory = bloat is minimised. I hope this helps... Paul -----Original Message----- From: tcl...@li... on behalf of salah jubeh Sent: Fri 3/03/2006 8:38 PM To: NAP Cc:=09 Subject: RE: [Tcl-nap-users] Nap Memory Problem I have just did the test on a third machine with fresh TCL = installation from http://www.activestate.com/Products/ActiveTcl/ and = with nap 5.0.5 the result again was negative. salah jubeh <s_...@ya...> wrote: Thank You very much for your = concern. =20 I hav did the same test=20 =20 8 % nap_info bytes 1348 1323435 9 % nap "result=3D get_gridascii('c:/red.asc')" ::NAP::6474-6474 10 % nap_info bytes 1312472 1323435 11 % unset result 12 % nap_info bytes 1348 1323435 13 %=20 In this test the nap looks like it works perfectly. but again i = checked wich84.exe proceess memory usage . the first reading was 12,000 = k and after the second time i used the code a bove it was about 30,000 k = and after 4 times it was a bout 85,000 k, also i checked memory page = file i get almost the same result. =20 Today i did also some test by allocating NAO objects and after several = times the tclsh crashes. =20 i will try to do the same test on other machines and i will see the = result.=20 =20 Har...@cs... wrote: Hi Salah, =20 The following is a log (using the unreleased version 6.0.0) of = creating & freeing a 100 MB array. The task manager showed that wish.exe started at 9 MB, went up to 112 = MB when the array was allocated & then decreased to 10 MB after the = freeing. The 1st number produced by =93nap_info bytes=94 shows the number of = byt es used by NAOs returned to 2696 after the freeing. =20 % nap_info bytes 2696 2696 40092 40146 % nap "a =3D reshape(9, {25 1024 1024})"; # create 100 MB array ::NAP::18-18 % nap_info bytes 104860544 104861500 72228 72884 % unset a % nap_info bytes 2696 104861500 72220 72884 =20 Hope this helps, Harvey Harvey Davies, CSIRO Marine and Atmospheric Research, Private Bag No. 1, Aspendale 3195 E-mail: har...@cs... Office: 03 9239 4556 Mobile: 04 2241 7563=20 -----Original Message----- From: tcl...@li... = [mailto:tcl...@li...] On Behalf Of salah = jubeh Sent: Friday, 3 March 2006 12:14 To: tcl...@li... Subject: [Tcl-nap-users] Nap Memory Problem =20 Hi Guys =20 I am working with NAP to do some image processing. i am using a nap = function "get_gridascii" to read arc grid ASCII files. the size of = images ranges from 2 MB to 100 MB and the platform that i am using is = WINXP. =20 I faced a problem such that the TCL shell give me message can not = allocate memory. after calling "get_gridascii" several times. =20 I used windows task manager utility to trace the process memory = usage I find that a little a mount is freed after destroying a NAO = object, I did the same test on two PCs and i get the same result on two = versions of TCL. =20 This is how i am using get_gridascii =20 nap "get_gridascii('red.ASC')"; ::NAP::16-16 =20 i used ::NAP::16-16 in order to free the memory but the memory did = not freed. =20 also i did another test like that=20 =20 nap "red=3Dget_gridascii('red.ASC')"; =20 and i used set red "" also i used unset red to free memory but the = memory did not freed. =20 I checked this with another versions like 5.0.3 and 5.0.2 and i get = the same result. =20 finally i made this test with 4.0.1 i get a good result doing the = same test ,The memory was freed BUT I tried to open an image a bout 80 = MB. the TCL shell stop responding. this image i was able to create ANO = Object out of it with NAP 5.0.5 but i could not do the same with NAP = 4.0.1. i did this test a gain twice an i faild to creat NAO object. =20 What is the cause of this problem , is it a bug . and how can i free = the memory. =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 < /DIV> =20 =20 =20 =20 =20 =20 =20 =20 =20 Best Regard =20 Eng. Salah Al Jubeh MCP,MCAD,MCSD=20 Mobile:00306947192421 =20 =20 =20 --------------------------------- =20 Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze.=20 =20 --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. =20 --------------------------------- Brings words and photos together (easily) with PhotoMail - it's free and works with Yahoo! Mail. =09 --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. |