memory leak?

88 views
Skip to first unread message

Mauricio Wittenberg

unread,
Sep 9, 2013, 2:20:17 PM9/9/13
to multi-m...@googlegroups.com
Hi, I've been running a few short tests (60s - 120s) and everything was looking OK. But when I tried running the same test for a much longer time, I realized that multi-mechanize was eating up all of my RAM (4GB).

Even if I just run a test like this:

class Transaction(object):
    def __init__(self):
        self.custom_timers = {}
        
    def run(self):
        assert (True)

with just one group and one thread, it ends up using up all of the memory.

Am I doing something wrong like not freeing memory or something like that?

Thanks,


Enisha Eshwar

unread,
Sep 11, 2013, 9:51:38 AM9/11/13
to multi-m...@googlegroups.com
Hello,

I do not think multi-mechanize consumes a lot of Memory.
I ran a python script with 20threads for >5mins and the Memory usage was just not more than 2% (of 4GB Physical memory).

Mauricio Wittenberg

unread,
Sep 11, 2013, 1:17:56 PM9/11/13
to multi-m...@googlegroups.com
Thanks for your reply,
Could you post your script to test it in my system and see what happens?

Regards,

Enisha Eshwar

unread,
Sep 12, 2013, 12:32:12 AM9/12/13
to multi-m...@googlegroups.com

Assign valid host names and port numbers in the below script>
The server where you are connecting to should have a port open for incoming connections.


#Python Script to establish TCP sockets and send data
import socket
import time

sock_array=[]
class Transaction(object):
        def run(self):
               
                #Initialise Variables
                host = 'XXX.XXX.com'
                port = 1234
                src = ''
                no_of_sockets = 10      
                message="XXX"

                #Create Socket
                while no_of_sockets !=0:
                        try:                              
                                s = socket.create_connection((host,port),10,(src,0))
                        except Exception, e:
                                print "Exception: "+str(e)
                        sock_array.append(s)
                        print sock_array
                        no_of_sockets-=1

                        #Send Message
                        remote_ip = socket.gethostbyname(host)
                        print 'Socket Connected to ' + host + ' on ip ' + remote_ip
                        s.sendall(message)
                        print 'Message send successfully'

                        reply = s.recv(4096)
                        if reply=="":
                            print "no response"
                        print reply
                 time.sleep(120)

if __name__ == '__main__':
        trans= Transaction()
        trans.run()


Thanks!
Reply all
Reply to author
Forward
0 new messages