13 from rtc_handle
import *
14 from BasicDataType_idl
import *
18 env =
RtmEnv(sys.argv, [
"localhost:9898"])
19 list0 = env.name_space[
"localhost:9898"].list_obj()
20 env.name_space[
'localhost:9898'].rtc_handles.keys()
21 ns = env.name_space[
'localhost:9898']
25 compo0 = ns.rtc_handles[
"ConsoleIn0.rtc"]
26 seqin0 = ns.rtc_handles[
"SequenceInComponent0.rtc"]
28 ec = compo0.rtc_ref.get_owned_contexts()
31 (stat, output) = commands.getstatusoutput(
"ps alxww | grep \"[r]\"tcd")
32 return output.split()[7]
38 fout.write(out_data +
'\n')
46 fout.write(out_data +
'\n')
52 if rss_start != rss_end:
53 fodat =
" result: memory leak was found !!!" 55 fodat =
" result: memory leak was not found." 60 test_case =
"AddRemoveRTCTest" 61 fout = open(test_case +
".log",
'w')
63 fodat =
"=== " + test_case +
" start ===" 68 fodat =
"add_component() and remove_component()" 71 for i
in range(loop_cnt):
73 retcode = ec[0].add_component(seqin0.rtc_ref)
76 retcode = ec[0].remove_component(seqin0.rtc_ref)
79 rss0 =
mem_rss() ; j0 = 0 ; rssStart = rss0
80 fodat =
" %05d: %s KB start" % (1, rss0)
84 fodat =
" %05d: %s KB -> %d KB. count diff -> %d" % (i+1, rss1,int(rss1)-int(rss0),int(j1)-int(j0) )
89 fodat =
" %05d: %s KB end" % (i+1, rssEnd)
94 fodat =
"=== " + test_case +
" end ==="
def print_file_and_cons(out_data, out_flag=0)
file and console out
def leak_check(rss_start, rss_end)
memory leak check