13 from rtc_handle
import *
14 from BasicDataType_idl
import *
15 from omniORB
import any
22 env =
RtmEnv(sys.argv, [
"localhost:9898"])
25 mgr_name = socket.gethostname()+
".host_cxt/manager.mgr" 27 manager = naming.resolve(mgr_name)._narrow(RTM.Manager)
29 manager.create_component(
"PeriodicECSharedComposite?instance_name=a&exported_ports=ConsoleIn0.out,ConsoleOut0.in")
33 listo = env.name_space[
"localhost:9898"].list_obj()
34 env.name_space[
'localhost:9898'].rtc_handles.keys()
36 ns = env.name_space[
'localhost:9898']
38 a0 = ns.rtc_handles[
"a.rtc"]
39 org = a0.rtc_ref.get_owned_organizations()[0]
40 config = a0.rtc_ref.get_configuration()
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 =
"AddRemoveOrganizationSDOPackageTest" 74 fout = open(test_case +
".log",
'w')
76 fodat =
"=== " + test_case +
" start ===" 81 fodat =
"add_organization() and remove_organization()" 84 for i
in range(loop_cnt):
85 id = org.get_organization_id()
88 config.add_organization (org)
91 config.remove_organization (id)
94 rss0 =
mem_rss() ; j0 = 0 ; rssStart = rss0
95 fodat =
" %05d: %s KB start" % (1, rss0)
99 fodat =
" %05d: %s KB -> %d KB. count diff -> %d" % (i+1, rss1,int(rss1)-int(rss0),int(j1)-int(j0) )
101 rss0 = rss1 ; j0 = j1
104 fodat =
" %05d: %s KB end" % (i+1, rssEnd)
109 fodat =
"=== " + test_case +
" end ==="
def leak_check(rss_start, rss_end)
memory leak check
def print_file_and_cons(out_data, out_flag=0)
file and console out