Re: [Moses-support] memory problems running moses server

2017-03-23 Thread Mathias Müller
Hi Sarah

What version of the Moses decoder (including the code for Moses server) do
you use exactly? Do you get an error message from the Moses server, i.e.
does it crash? Is the process killed by the OS because of memory problems?

If you can also supply a toy model and ini file, other people can try and
reproduce your issue.

Regards!
Mathias

—

Mathias Müller
AND-2-20
Institute of Computational Linguistics
University of Zurich
Switzerland
+41 44 635 75 81
mathias.muel...@uzh.ch

On Thu, Mar 23, 2017 at 11:17 AM, Sarah Schulz <
sarah.sch...@ims.uni-stuttgart.de> wrote:

> Hi everyone,
>
> It seems like I run into memory problems when using moses server even
> though I have plenty of memory available.
>
> I isolated the problem in a little script (attached). I start the server
> and send strings for translation iteratively. At a certain point it will
> send the request and wait for a reply forever. The number of iterations
> decreases, when I increase the length of the string.
> It seems as if the already sent requests are "piling up" somewhere in
> the server's or client's memory and at a certain point it doesn't have
> the capacity to process the new request.
>
> Has anyone gone through anything similar?
>
> Cheers
> Sarah
> --
> Sarah Schulz
> University of Stuttgart
> Institute for Natural Language Processing (IMS)
> Pfaffenwaldring 5B, 70569 Stuttgart
> Germany
>
> http://www.ims.uni-stuttgart.de/institut/mitarbeiter/schulzsh/
>
> ___
> Moses-support mailing list
> Moses-support@mit.edu
> http://mailman.mit.edu/mailman/listinfo/moses-support
>
>
___
Moses-support mailing list
Moses-support@mit.edu
http://mailman.mit.edu/mailman/listinfo/moses-support


[Moses-support] memory problems running moses server

2017-03-23 Thread Sarah Schulz
Hi everyone,

It seems like I run into memory problems when using moses server even
though I have plenty of memory available.

I isolated the problem in a little script (attached). I start the server
and send strings for translation iteratively. At a certain point it will
send the request and wait for a reply forever. The number of iterations
decreases, when I increase the length of the string.
It seems as if the already sent requests are "piling up" somewhere in
the server's or client's memory and at a certain point it doesn't have
the capacity to process the new request.

Has anyone gone through anything similar?

Cheers
Sarah
-- 
Sarah Schulz
University of Stuttgart
Institute for Natural Language Processing (IMS)
Pfaffenwaldring 5B, 70569 Stuttgart
Germany

http://www.ims.uni-stuttgart.de/institut/mitarbeiter/schulzsh/
import random
import xmlrpclib as x
import time
import sys
import subprocess

#initialize random port and start moses server as subprocess
port_uni= str(random.randint(4, 5))
p1 = subprocess.Popen("/mount/arbeitsdaten13/users/schulzsh/tools/Moses/mosesdecoder/bin/mosesserver -f ../static/Moses/decoder_files/SMT_Werther_uni.ini --server-port "+ port_uni,stderr=subprocess.PIPE,bufsize=8000,shell=True,env={"LD_LIBRARY_PATH":"/mount/projekte/sfb-732/inf/users/sarah/tools/xmlrpc-c/lib"})

#wait for it to start sucessfully
elapsed_time=0
start_time = time.time()
   
err=''
out=''
for line in iter(p1.stderr.readline, ''):

if "Listening on port" in line or elapsed_time > 150:
print "loaded uni1"
break
   
elapsed_time = time.time() - start_time

if elapsed_time >= 150:
print "SMT Unigram Server Mode doesn't start."
sys.exit()

#connect to ServerProxy
s_unigram = x.ServerProxy("http://localhost:"+port_uni+"/RPC2",allow_none=True,verbose=True)


#send a message to moses server for translation
#note: when message length increases, the bug appears after fewer iterations
for i in range(1000):

trans= s_unigram.translate({"text":"# I c h j k k k # k k k k  k k k k k k k #","align":"true"})
print trans
print i
___
Moses-support mailing list
Moses-support@mit.edu
http://mailman.mit.edu/mailman/listinfo/moses-support