| [ CnUnix ] in KIDS 글 쓴 이(By): flesh (t(-_-t);;) 날 짜 (Date): 2002년 7월 30일 화요일 오후 10시 57분 11초 제 목(Title): Re: 프로그램의 메모리 사용량 증가.. 발췌 http://www.strath.ac.uk --- Another class of local variable is the static type. A static can only be accessed from the function in which it was declared, like a local variable. The static variable is not destroyed on exit from the function, instead its value is preserved, and becomes available again when the function is next called. Static variables are declared as local variables, but the declaration is preceeded by the word static. static int counter; Static variables can be initialised as normal, the initialisation is performed once only, when the program starts up. --- static은 local scope 를 갖지만, 그 메모리의 release는 exit 순간입니다. 또한 복수번 call 되었다고 해서, 계속 잡히는 것이 아니라, exit 순간까지 동일한 영역이 유지되지요. --- 저 function을 계속 fork() 하신후 실행하십니까? 자료가 부족스러운듯... :) 참고로 저의 미천한 소견으로, thread 에선 static 공간이 공유되서 오히려 synchronization이 필요하다고 봅니다. Sincerely yours. - from devil |