13 from rtc_handle
import *
14 from BasicDataType_idl
import *
15 from CorbaNaming
import *
21 env =
RtmEnv(sys.argv, [
"localhost:9898"])
23 mgr_name=socket.gethostname()+
".host_cxt/manager.mgr" 25 manager = naming.resolve(mgr_name)._narrow(RTM.Manager)
30 (stat, output) = commands.getstatusoutput(
"ps alxww | grep \"[r]\"tcd")
31 return output.split()[7]
37 fout.write(out_data +
'\n')
45 fout.write(out_data +
'\n')
51 if rss_start != rss_end:
52 fodat =
" result: memory leak was found !!!" 54 fodat =
" result: memory leak was not found." 59 test_case =
"CreateDeleteRTCTest" 60 fout = open(test_case +
".log",
'w')
62 fodat =
"=== " + test_case +
" start ===" 67 fodat =
"load_module() and unload_module()" 70 for i
in range(loop_cnt):
74 retcode = manager.unload_module(
".//ConsoleOut.so")
81 retcode = manager.load_module(
"ConsoleOut.so",
"ConsoleOutInit")
85 rss0 =
mem_rss() ; j0 = 0 ; rssStart = rss0
86 fodat =
" %05d: %s KB start" % (1, rss0)
90 fodat =
" %05d: %s KB -> %d KB. count diff -> %d" % (i+1, rss1,int(rss1)-int(rss0),int(j1)-int(j0) )
95 fodat =
" %05d: %s KB end" % (i+1, rssEnd)
99 fodat =
"create_component() and delete_component()" 102 for i
in range(loop_cnt):
104 ret0 = manager.delete_component(
"ConsoleOut0")
109 obj0 = manager.create_component(
"ConsoleOut")
114 rss0 =
mem_rss() ; j0 = 0 ; rssStart = rss0
115 fodat =
" %05d: %s KB start" % (1, rss0)
119 fodat =
" %05d: %s KB -> %d KB. count diff -> %d" % (i+1, rss1,int(rss1)-int(rss0),int(j1)-int(j0) )
121 rss0 = rss1 ; j0 = j1
124 fodat =
" %05d: %s KB end" % (i+1, rssEnd)
129 fodat =
"=== " + test_case +
" end ===" 133 manager.delete_component(
"ConsoleOut0")
def print_file_and_cons(out_data, out_flag=0)
file and console out
def leak_check(rss_start, rss_end)
memory leak check