Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 37 results for
filedescriptor
- Page 1
python project help required!
Programming
Software Development
15 Years Ago
by rapid_gezer
…)] 6. To open a file for output, remember:
fileDescriptor
= open(‘fName.txt’,’w’)
fileDescriptor
.write(‘stuffToWrite’) Note you can only write strings… a string in order to write it to the file!
fileDescriptor
.close() # Very important to close the file! 7. To create…
segmentationfault (plz answer asap)
Programming
Software Development
13 Years Ago
by fatemeG
…/Desktop/text.txt/',0 handler dd 10 ;baraye negah dashtane
filedescriptor
section .bss inputStr resb 100000 section .text global _start: _start… file descriptor in eax mov [handler],eax ;azin b bad
filedescriptor
dar handler ast ;read from keyboard mov eax,3 mov…
Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
…192 java.nio.HeapCharBuffer 83: 7 168 java.io.
FileDescriptor
84: 5 160 java.io.DataInputStream 85: 2…1488 java.util.HashMap 53: 61 1464 java.io.
FileDescriptor
54: 14 1456 java.lang.Thread 55: 8…
Linux Shell Piping Problem
Programming
Software Development
18 Years Ago
by kharri5
… std out of the child, then putting the piped value
filedescriptor
for stdout into the child. Then in parent. I'm…
Re: Forks and Shared Memory in C (Linux OS)
Programming
Software Development
14 Years Ago
by venomxxl
…// Variables }SharedMemory; static int
FileDescriptor
; static SharedMemory * Memory; void SharedMemoryMap(){
FileDescriptor
=open("/dev/zero", O_RDWR…); if(
FileDescriptor
==-1){ // Error } Memory=(…
Re: Java FTP Server
Programming
Software Development
15 Years Ago
by Alex Edwards
… the receiving application write those bytes to a File (or
FileDescriptor
object if that is possible). Edit: Here's an Open…
Re: Program Won't Run
Programming
Software Development
12 Years Ago
by DaniwebOS
… append) Constructs a FileWriter object given a File object. FileWriter(
FileDescriptor
fd) Constructs a FileWriter object associated with a file descriptor…
Re: python project help required!
Programming
Software Development
15 Years Ago
by sneekula
Interesting assignment, with an excellent explanation by the teacher. Would be nice to know what table.csv roughly looks like. Should be relatively simple yet challenging to solve. Just a note, don't use l1, l2, l3 ... for variable names, they look too much like the numbers 11, 12, 13 ...
Re: python project help required!
Programming
Software Development
15 Years Ago
by woooee
[QUOTE]but i do not know how to seperate the whole file into the 49 different months. and thake their averages.[/QUOTE]I'm not going to read the whole problem; it's way too long. Post some sample input data and state specifically what you do not understand. In the code you posted, it is already a list of lists so you should be able to loop …
Re: segmentationfault (plz answer asap)
Programming
Software Development
13 Years Ago
by SamY
what memory offset does your code start at? Maybe you reached a boundary limit and it wrapped around going to another area thus causing that error
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by JamesCherrill
I don't have time to study all that data right now, but it does make me wonder if you are confusing closing the Socket with releasing the Socket object for garbage collection. Even if you close the Socket there will still be a current Socket object until the very last reference to it goes out of scope or is given a new value. Maybe you are hanging…
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
I am not sure what I am doing in a finally section this writeBuffer.close();. I dont know what else to close here?
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by ObSys
Thats a lot of data to analyse, but after a quick look, I see you haven't closed the socket. You have closed the BufferedWriter that writes along the socket but not the socket itself. I don't know if i'm 100% correct here but it's all I could think of. Good Luck
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
Dear Obsy, I have tried colosing it and even initialise back to null no difference.
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by ~s.o.s~
Two important points: 1. What is the time interval between taking the `jmap` dump and closing the sockets? Your close calls don't immediately take effect since there is a certain teardown time 2. Did you also monitor the log file? Were there any exceptions in the logs?
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
Dear Sos, 1.There are many sockets running so I cant decide on when the exactly the socket is closed. Normally what is the time gap between for the teardown time? 2. Yes there are times this exception "java.net.SocketTimeoutException: Read timed out" but still it should be handled by the finally section right?…
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by ~s.o.s~
> There are many sockets running so I cant decide on when the exactly the socket is closed. Normally what is the time gap between for the teardown time? Don't use `jmap` for finding open sockets in your system; use an OS specific utility like [netstat](http://www.cyberciti.biz/tips/linux-display-open-ports-owner.html) or something else to find…
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
Dear Sos, I am on linux platform I do use this command too netstat -nat |grep 9000 | awk '{print $6}' | sort | uniq -c | sort -n . But this one shows me well the connection are fluctuating meaning they are closed and open. Any other method to check on them? So why jmap is not the right tool what are those instances in it then…
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by ~s.o.s~
I can't do any meaningful analysis sitting here but I would recommend you approach this problem in a organized way. From your post, if seems that you have multiple issues: open sockets, timeout exceptions, Socket objects in memory and GC issues. Tackle them one at a time. Refactor your code so that the reading records from database part is a …
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
Dear Sos, Ok I will listen to your advice. Ok what I post here first is my snippet codes. In that post I wrote strip down my application just to have the socket purely and capture the histo when it just activated and after 50 socket connection closed so this is 52 5824 java.net.SocksSocketImpl where its referring too. So in that…
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
Dear Sos, I actually followed this link http://stackoverflow.com/questions/3428127/what-is-the-difference-between-closing-input-outputstream-and-closing-socket-dir which says just close the writeBuffer will be enough.
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by ~s.o.s~
> I actually followed this link http://stackoverflow.com/questions/3428127/what-is-the-difference-between-closing-input-outputstream-and-closing-socket-dir which says just close the writeBuffer will be enough. Just to try out something else, close all 3: first the output stream, then the input stream and then the socket. This is in line with …
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
Dear Sos, Here is my strip down of my codes and changes you recommended. I close the write buffer followed by read and finall the socket itself. This is a very fundamental codes nothing in side purely socket only. try{ while ((nextChar=readBuffer.read()) != -1){ …
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by ~s.o.s~
I believe this is the serverside dump. How are you simulating the test code? Have you writtent a multithreaded client which does this? Are you doing proper cleanup in the client code? Also, run the following command for jmap: `jmap -histo:live pid` to force a GC. Also, DON'T immediately run `jmap`. Start up the server, take jmap, start banging it …
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
Here is my client codes for the simulation. import java.io.*; import java.net.*; import java.util.*; import java.util.Date; import java.text.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import …
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by ~s.o.s~
So basically now you don't have 50 open sockets on the server? Correct? Or do you still have a query/question?
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
Dear Sos, I run this for loop for (int i = 0; i < 50; i++) { and in it I close each socket and reopen a new one. Off course its not parallel but is in sequence. So what is your advice here where is the leakages happening? I did try to wait after 5 minutes yet the results is same just like I take the jmap immediately after all …
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by ~s.o.s~
I'm not sure I understand. Your above post shows that the jmap prints 8 lie SocketInputStream instances. Why do you say the results are the same?
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by newbie14
Dear Sos, Sorry for the confusion that 8 SocketInputStream instances are after the jmap -histo:live pid not after waiting for 5 minutes. So based on these data collection what is your advice to me?
Re: Sockets are retain even after closing them?
Programming
Software Development
10 Years Ago
by ~s.o.s~
OK, let me be a bit more explicit. The 8 instances, were they on the server? If yes, did you do the jmap after running the 50 connection test i.e. were they after running the test or before?
1
2
Next
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC