How ports are occupied to resolve

Source: Internet
Author: User
Tags memory usage

Often, we start the application when the system needs to find the port is occupied, how to know who owns the port, a lot of people are more headache, the following is a very simple method, we hope to be useful

If we need to determine who's taking up our 8080 port,

1. You can view all port occupancy by cmd----"Netstat-ano instructions.
C:\users\administrator>netstat-ano

Active connections

Protocol local address external address state PID

TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 472
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:801 0.0.0.0:0 LISTENING 9524
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 2416
TCP 0.0.0.0:5001 0.0.0.0:0 LISTENING 9524
TCP 0.0.0.0:7879 0.0.0.0:0 LISTENING 4860
TCP 0.0.0.0:8009 0.0.0.0:0 LISTENING 9524
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 9524
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING 536
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING 1052
TCP 0.0.0.0:49157 0.0.0.0:0 LISTENING 616
TCP 0.0.0.0:49160 0.0.0.0:0 LISTENING 1116
TCP 0.0.0.0:49172 0.0.0.0:0 LISTENING 600
TCP 0.0.0.0:49202 0.0.0.0:0 LISTENING 2100
TCP 3.3.10.190:139 0.0.0.0:0 LISTENING 4
TCP 3.3.10.190:51248 10.1.1.3:9090 established 4860
TCP 3.3.10.190:52308 10.10.34.22:80 established 1280
TCP 127.0.0.1:4300 0.0.0.0:0 LISTENING 7060
TCP 127.0.0.1:4301 0.0.0.0:0 LISTENING 7060
TCP 127.0.0.1:8005 0.0.0.0:0 LISTENING 9524
TCP 127.0.0.1:8411 0.0.0.0:0 LISTENING 952
TCP 127.0.0.1:20001 0.0.0.0:0 LISTENING 2620
TCP 127.0.0.1:27382 0.0.0.0:0 LISTENING 3116
TCP 127.0.0.1:49220 127.0.0.1:62522 established 4328
TCP 127.0.0.1:49392 127.0.0.1:49393 established 4860
TCP 127.0.0.1:49393 127.0.0.1:49392 established 4860
TCP 127.0.0.1:50176 127.0.0.1:50177 established 4860
TCP 127.0.0.1:50177 127.0.0.1:50176 established 4860
TCP 127.0.0.1:50183 127.0.0.1:50184 established 6512
TCP 127.0.0.1:50184 127.0.0.1:50183 established 6512
TCP 127.0.0.1:50437 127.0.0.1:50438 established 4860
TCP 127.0.0.1:51249 127.0.0.1:51250 established 4860
TCP 127.0.0.1:51250 127.0.0.1:51249 established 4860
TCP 127.0.0.1:51544 127.0.0.1:51547 established 3108
TCP 127.0.0.1:51547 127.0.0.1:51544 established 9524
TCP 127.0.0.1:62522 0.0.0.0:0 LISTENING 1628
TCP 127.0.0.1:62522 127.0.0.1:49220 established 1628
TCP 192.168.3.7:139 0.0.0.0:0 LISTENING 4
TCP 192.168.3.7:51121 101.231.218.251:444 established 1628
TCP 192.168.3.7:51309 182.118.125.130:80 close_wait 1280
TCP 192.168.3.7:51537 123.155.153.149:80 close_wait 7060
TCP 192.168.3.7:51554 180.168.156.212:2033 established 9524
TCP 192.168.3.7:51559 180.168.156.212:2033 established 9524
TCP 192.168.3.7:51757 180.168.156.212:2033 established 9524
Note: Only part of the clip is intercepted

2. Check the occupancy of the specified port c:\users\administrator>netstat-aon|findstr "8080"

C:\users\administrator>netstat-aon|findstr "8080"

Protocol local address external address state PID
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 9524
TCP [::]:8080 [::]:0 LISTENING 9524


P: See, Port is occupied by process number 9524 process, continue to execute the following command: (You can also go to the task Manager to see the PID corresponding process)

3. View the PID corresponding process
C:\users\administrator>tasklist|findstr "9524"

Image name PID session name Session # Memory usage

Javaw.exe 9524 Console 1 886,132 K

P: It's clear that Java.exe is taking up your port. 4. End the process c:\users\administrator>taskkill/f/t/im Java.exe

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.