You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create a Julia server instance by using ZMQ with the Req/Rep pattern. My Julia code for the Rep-server looks like this:
module JServer
import zmq
using ZMQ
import Base.gc
create context
ctx=Context();
create socket
socket=Socket(ctx, REP);
msg
msg = 0;
repeatedly collect garbage every second
timer = Timer(gc, 1, 1);
function connect(host, port)
# connect
ZMQ.connect(socket, string("tcp://", host, ":", port));
println(string("Julia server connected to ", host, " on port ", port));
end
function startServer()
# notify
println("Waiting for request...")
i = 1
while i <= 2
# invoke garbage collection
# gc();
# Poll For message
msg = receive();
println("Message received");
# Reply
send();
println("Message acknowledged");
end
end
function receive()
msg = ZMQ.recv(socket);
end
function send()
ZMQ.send(socket, Message("test request"));
end
function gc(event)
gc();
end
end
I can successfully start the server by runnung this script (indicating host and port via ARGS):
My tests seem to be odd, however: Whenever I send large messages from client, i.e. ~1MB per message, Julia seems to properly keep tracking about memory usage: The overall process memory remains constant. But when I am sending small messaged (i.e. 10k per message) Julia memory usage is growing permanenlty. In addition response time slows down over my requests.
Is my code ok?
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to create a Julia server instance by using ZMQ with the Req/Rep pattern. My Julia code for the Rep-server looks like this:
I can successfully start the server by runnung this script (indicating host and port via ARGS):
My tests seem to be odd, however: Whenever I send large messages from client, i.e. ~1MB per message, Julia seems to properly keep tracking about memory usage: The overall process memory remains constant. But when I am sending small messaged (i.e. 10k per message) Julia memory usage is growing permanenlty. In addition response time slows down over my requests.
Is my code ok?
The text was updated successfully, but these errors were encountered: