14 from rtc_handle
import *
15 from BasicDataType_idl
import *
16 from omniORB
import any
23 env =
RtmEnv(sys.argv, [
"localhost:9898"])
26 mgr_name = socket.gethostname()+
".host_cxt/manager.mgr" 28 manager = naming.resolve(mgr_name)._narrow(RTM.Manager)
30 manager.create_component(
"PeriodicECSharedComposite?instance_name=a&exported_ports=ConsoleIn0.out,ConsoleOut0.in")
34 listo = env.name_space[
"localhost:9898"].list_obj()
35 env.name_space[
'localhost:9898'].rtc_handles.keys()
37 ns = env.name_space[
'localhost:9898']
39 seqin0 = ns.rtc_handles[
"SequenceInComponent0.rtc"]
40 a0 = ns.rtc_handles[
"a.rtc"]
41 org = a0.rtc_ref.get_owned_organizations()[0]
44 (stat, output) = commands.getstatusoutput(
"ps alxww | grep \"[r]\"tcd")
45 return output.split()[7]
51 fout.write(out_data +
'\n')
59 fout.write(out_data +
'\n')
65 if rss_start != rss_end:
66 fodat =
" result: memory leak was found !!!" 68 fodat =
" result: memory leak was not found." 73 test_case =
"AddRemoveMemberSDOPackageTest" 74 fout = open(test_case +
".log",
'w')
76 fodat =
"=== " + test_case +
" start ===" 81 fodat =
"add_members() and remove_member()" 84 for i
in range(loop_cnt):
86 org.add_members ([seqin0.rtc_ref])
89 org.remove_member (seqin0.rtc_ref.get_sdo_id())
92 rss0 =
mem_rss() ; j0 = 0 ; rssStart = rss0
93 fodat =
" %05d: %s KB start" % (1, rss0)
97 fodat =
" %05d: %s KB -> %d KB. count diff -> %d" % (i+1, rss1,int(rss1)-int(rss0),int(j1)-int(j0) )
102 fodat =
" %05d: %s KB end" % (i+1, rssEnd)
107 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