Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:ARM
ksh
vmbalance
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File vmbalance of Package ksh
#!/usr/bin/awk -f # # vmblance Awk script to detect endless growing memory alloctions # in endless shell loops using in daemonized shell scripts # # Usage: # # strace -s 128 -e execve,mmap,mmap2,munmap -o '|./vmbalance' ksh leak1.sh # BEGIN { FS="([[:blank:]]|[[:punct:]])" ignore="" script="" sum=0 allocs=0 frees=0 } /^execve/ { if (FNR == 1) { script = gensub(/.*SOURCES\/([[:alnum:]_-]+\.sh).*/, "\\1", "g", $0) } } /^mmap(2|64)?\(/ { if ($0 !~ /.*MAP_PRIVATE\|MAP_ANONYMOUS.*/) { if (ignore) ignore=ignore "|" $NF else ignore=$NF } else { sum+=$4 allocs++ } } /^munmap(2|64)?\(/ { if ($0 !~ ignore) { sum-=$4 frees++ } } END { print script ": " sum " bytes with " allocs " chunks allocated and " frees " chunks freed" > "/dev/fd/3" }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor