Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!

Elhanan Maayan

Ranch Hand
+ Follow
since May 04, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Elhanan Maayan

hi..
we have a server which sends out messages in protobuff format.
the problem is that so far only netty has been able to parse using it's protobuff adapters.
now i don't know much about netty (as in nothing at all) and i don't want to add another library,but attempting to use any other library starting java normal socket.accept and java's nio2 failed.
i'm guessing this has something to do with the "frameDecoder" it uses" , i tried to do the same in nio2, but that didn't work.
hi.

we have a build project which we run on a jenkins slave. now more then once, the build start, but simply doesn't run the maven, we know this becuse the build also has a shell script which tries to move to directory created by the build but which doesn't exists
we are using version 1.586
looking at the logs i see at times (Hudson64bit is the slave)

and at times.

3:31:37 PM SEVERE hudson.remoting.SynchronousCommandTransport$ReaderThread run
I/O error in channel Channel to Maven [c:\opencm\jdk6/bin/java, -server, -Xms1024m, -Xmx1024m, -XX:PermSize=128m, -XX:MaxPermSize=128m, -cp, C:\opencm\tomcat\bin\..\..\hudson\plugins\maven-plugin\WEB-INF\lib\maven3-agent-1.5.jar;c:\opencm\apache-maven-3.0.5\boot\plexus-classworlds-2.4.jar, org.jvnet.hudson.maven3.agent.Maven3Main, c:\opencm\apache-maven-3.0.5, C:\opencm\tomcat\webapps\jenkins\WEB-INF\lib\remoting-2.46.jar, C:\opencm\tomcat\bin\..\..\hudson\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-1.5.jar, C:\opencm\tomcat\bin\..\..\hudson\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.5.jar, 3495]
coudl this be related?
3 years ago
No dump were produced, this is because they JVM didn't die from OutOfMemory Exception but rather the oom killed the dmesg indicates the total-vm was like 10gb while the anon-rss was 7.8 of the process that was killed.
3 years ago
i'm getting this warning several times on our logs, doing dmesg on 'killed process' indicates java process has been killed several times .

this is running on a vm, and the xmx is usually set to take entire machine's allocated memory minus 1gb .
3 years ago
hi...

does anyone know of a detailed article about Netty and protobuff? and i'm not talking about just examples, i'm talking about explanations of which classes are used and why?
the weird part is that OOM shouldn't be activated, we use xmx to always specify memory size smaller by one gb the the vm's memory. meaning if the vm's memory is 8gb we use 7.
3 years ago
can this be shown in netstat or other commands?
hi..
we have a strange problem,
we send a signal to a device in udp protocol which responds back to us .
according to wireshark the time interval between the signal being sent and the reply from the device is a few ms. however in our logs which are being printed right next to the UDP socket api the gap is like 2 seconds. which means something between wireshark and our application is delaying the traffic, is there a way i can check for it? (btw there's no high load on the cpu)
there's nothing in system but this process, it's a dedicated vm, the maybe oom's heuristics don't match up correctly here .

we have a server that sends us a soap request with a large xml including many attachments of gif/jpeg/png files which we then analyze using ImageIcon class to extract it's dimentions. xml itself is dealt with DOM (no jaxb marshaling or anything)

we also see cases where top indicates usage of 150% or even 197 , which i understand can happen when you use more then one core.

we requested to vm to be have 8gb of dedicated memory, but only have 4 of it dedicated. (they won't allow 4 more without proof we need more resources)

btw this is java 6 build 25

3 years ago
hi..

while i know that OOM-killer is usefull for machines that have more then one process, we have a vm with only one process, that tends to get killed when it recieves large chunks of communications, dmesg indicate that oom-killer was at works, so i was wonder if it's ok to disable it.
[ 145.614194] Killed process 1503 (java) total-vm:10264060kB, anon-rss:7919392kB, file-rss:0kB
[ 145.897401] Killed process 1202 (java) total-vm:4037188kB, anon-rss:3856kB, file-rss:0kB
[55796.674830] Killed process 1831 (java) total-vm:10203812kB, anon-rss:7805060kB, file-rss:0kB
[75956.949679] Killed process 14681 (java) total-vm:10199932kB, anon-rss:7852576kB, file-rss:0kB
[75957.053241] Killed process 1658 (java) total-vm:4236880kB, anon-rss:46708kB, file-rss:0kB
[76366.957083] Killed process 2628 (java) total-vm:10215660kB, anon-rss:7894140kB, file-rss:0kB
[76367.071981] Killed process 2034 (java) total-vm:4103752kB, anon-rss:25520kB, file-rss:0kB
[76469.704886] Killed process 5376 (java) total-vm:10196872kB, anon-rss:7844800kB, file-rss:0kB
[76761.420596] Killed process 7400 (java) total-vm:10219820kB, anon-rss:7892404kB, file-rss:0kB
[76761.842409] Killed process 5202 (java) total-vm:4103752kB, anon-rss:22860kB, file-rss:0kB
[231505.019515] Killed process 9367 (java) total-vm:10134684kB, anon-rss:7804720kB, file-rss:0kB
[232227.708168] Killed process 15862 (java) total-vm:10125300kB, anon-rss:7898536kB, file-rss:0kB
[232227.868810] Killed process 9000 (java) total-vm:4236880kB, anon-rss:12244kB, file-rss:0kB
[232771.681270] Killed process 16321 (java) total-vm:10207732kB, anon-rss:7900632kB, file-rss:0kB

3 years ago
hi..

we recently noticed that cobetura started failing in maving on testing with NoSuchMethod on logger.trace..

we checked and we are using slf4j 1.2 which doesn't seem to have such method, it seems that a project of ours and it's using slf4j version 1.2 while cobetura uses 1.7

is there something i can do other then changing our pom to adapt for cobetura's dependencies?
3 years ago

Mike Simmons wrote:Are you asking if it's possible that floating point calculations are the bottleneck in your program? Sure, I suppose it's possible. Hard to tell really, but it's always possible for something to be a bottleneck if it's repeated enough times in a tight loop. However, looking at your method, I might first consider that the biggest performance hit comes from the use of a Map, _weightedMap. Considering both the key and value are primitives, this results in a lot of boxing and unboxing, in addition to the hashing and lookup. And considering you assume that all possible key values will have a weight entry (else there would be a NullPointerException) - could you perhaps just use a float[] array instead? Where the key becomes the index of the array? (You might have to add an offset to ensure the index is positive.) I suspect this would eliminate your biggest current bottleneck. Might be worth a try, at least.



actually i considered that as well, but using an array didn't work, i don't recall if i used Float[] or float[] , but having the array, didn't do much. the table itself was only 70 values, i had to negate the keys as they were negative, so i doubled them by -1, before extraction by index.
but as i said, that didn't help.
3 years ago
we have this little method the runs on a nested loop (outer loop runs on around 8000 cells array, inner loop runs on 12 cells)

the entire thing runs on a sperate thread that iterates on a loop (it cannot run on multiple threads.
we've discovered that using the float values _weightedMap actually slows the down process, (values in the queue the thread is working on build up) even jprofilder won't show this specific method as the bottle neck but only the methods which run the outer loop.

could this be possible (this is java 7)

3 years ago
i'm making it my own, because even though it was came formatted so from a different system, since we have code that uses, it would be easier to use that code then re-factor to a new format, which would basically be the same.

currently the only protocol i know is soap and xml, future systems maybe different protocols but as these services should be public i'm guess they would be standard protocols.

i'm pretty sure there will be new systems connecting in the future, i'm just not sure what they will be, (they would be the same type of system, just different vendors)
3 years ago