Yar lag

Greenhorn
+ Follow
since Apr 14, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 Yar lag

We have a simple client server architecture between our mobile device and our server both written in Java. An extremely simple ServerSocket and Socket implementation. However one problem is that when the client terminates abruptly (without closing the socket properly) the server does not know that it is disconnected. Furthermore, the server can continue to write to this socket without getting any exceptions. Why?

According to documentation Java sockets should throw exceptions if you try to write to a socket that is not reachable on the other end!
Thanks for the suggestions! But no, I don't have static data and no native calls. Any ideas? Maybe some tools that I can use?
14 years ago
We have a java process running as a server here on linux. The problem is, the VIRT usage of this process is ever growing. And eventually the linux system runs out of SWAP and the system dies. However, the profiler shows that

1) The number of threads does not grow
2) The heap usage does not grow

I'm at a lost as to what is using all that memory outside of heap. Any ideas what might be the cause and what tools I might be able to use?
14 years ago
I have a java standalone program with default settings. Now I have looked up the documentation and it says that the default heap size is 64Mb for 1.6 JVM. I am running in 64bit env so the documentation said a 30% will be added, which is around 83Mb.

Sure enough, in my standalone program, when I print Runtime.maxMemory(), I get the number 85196800.
Now the other thing I observe is that the "used" memory by calling this Runtime.getRuntime().totalMemory () - Runtime.getRuntime().freeMemory ();
I noticed that whenever that "used" number approaches near 85196800, it drops back down to the 6000000 range. Again, this makes perfect sense as I understand it because gc will try to clean up when it is near max heap size. So far so good, but correct me if I am wrong.

Now, the problem is this: if I use TOP in my unix server, I noticed that over time the Java process grows in the VIRT field. This field is suppose to represent the amount of virtual memory. It just keeps growing, and right now it is as 1450Mb. Why is this? I thought the whole point of the max heap size, is that the JVM will not grow past that amount of memory usage? Needless to say, this eats into my swap space and ultimately brought my server down to its knew (the machine only have 256mb ram).

Another side point is that the RES field is always at 160Mb. Now I don't quite understand how 160 is still bigger than the 83Mb, I'm guessing that the other 77 Mb is for some things that are outside of the heap

Can anyone explain what is really going on here? And how do I limit this jvm process such that it will not eat up all resources on this server and bring it to a halt?

Thanks!!
14 years ago
I don't see how BigDecimal can help with this at all, have you read my requirements?
14 years ago
thanks for the help, but like I said, I don't have a choice as to how I receive the input. The input is a string, in scientic notation format. I need to convert this string into another string. That is my task. Any help?
14 years ago
I have a string that comes in the format similar to this "0E-8". I have no control what format this string comes in. I have to expend this string into a string of "0.00000000". This is for a financial application so the exact length of the string is important. Does anyone know of a way how? Thanks!
14 years ago
John thanks for the quick reply, but no that wouldn't work. What I'm trying to do is this:

Process 1 -> Set up a new env with user.name="John"
Process 1 -> Launch a new jvm with the above env
Process 2 -> Starts and read in the user.name and picks up "John"

I hope that makes sense, any ideas how to setup the env?
14 years ago
I know you can get the currently logged in user name (in windows or unix) by doing System.getProperty("user.name"). But how exactly is this variable set? Is it set by a system env variable (in unix)? So for example, if I am launching a new process with Runtime.exec("myJavaCommand"). Is it possible to change the user.name variable for that spawned process? Any ideas? Thank you!
14 years ago
Hello,

I have a simple situation where inside a div, it has the following items:

<div>
<sx:autocompleter valueNotifyTopics="change" />
<sx:submit targets="windowframe" listenTopics="change" indicator="loader" cssStyle="display:none" />
</div>

The idea, is that when you select something in the autocompleter, it submits the form to somewhere.


Now everything works, it does submit. But the problem is, this div is loaded using <sx:div>'s ajax. That means this div can be loaded into the current document multiple times. And I find each time this div is loaded, the listenTopics get added once. So if I fire the ajax div 5 times, the form will be submitted 5 times when I choose something in the autocompleter! Any ideas how to fix this? Please help! Thank you!
14 years ago