Slight growth of memory detected
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Domínio
- networking
Direção de pesquisa
Comece reproduzindo o teste de memória fornecido com get_active_devices e get_interfaces_info, incluindo o caso de um nome de interface inválido. Rastreie esses pontos de entrada pelos bindings Python e pela implementação nativa do repositório e, em seguida, repita as medições após cada investigação. O trabalho estará concluído quando chamadas repetidas não mostrarem mais crescimento mensurável de memória.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Get this script (GPLv2 Copyright (c) 2011 Red Hat):
import ethtool
import subprocess, sys, os
max = int(sys.argv[1])
nic = sys.argv[2]
total = 0
def memory():
""" Get current memory usage in MB """
command = "ps --no-header -o rss -p %s" % os.getpid()
p = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
stdout, stderr = p.communicate()
return int(stdout) / 1024
def measure(fun, arg):
""" Run given function on given arg max times """
global total
print("\n%s on %s" % (fun, arg))
start = None
for i in range(max + 1):
result = fun(arg)
if i % (max / 10) == 0:
current = memory()
# note the memory after the first round warm-up
if start is None:
start = current
print("%s %% ... %s MB" % \
(str(100 * i / max).rjust(3), str(current).rjust(3)))
increase = current - start
print("Memory increase: %s MB" % increase)
total += increase
measure(ethtool.get_active_devices, None)
measure(ethtool.get_interfaces_info, nic)
measure(ethtool.get_interfaces_info, 'bad interface name')
print("\nTotal memory increase: %s MB" % total)
if total > 0:
sys.exit(1)
And run:
$ python3.6 ~/tmp/memory.py 1000000 ens3
<built-in function get_active_devices> on None
0.0 % ... 10.1328125 MB
10.0 % ... 10.13671875 MB
20.0 % ... 10.13671875 MB
30.0 % ... 10.13671875 MB
40.0 % ... 10.13671875 MB
50.0 % ... 10.13671875 MB
60.0 % ... 10.13671875 MB
70.0 % ... 10.13671875 MB
80.0 % ... 10.13671875 MB
90.0 % ... 10.13671875 MB
100.0 % ... 10.13671875 MB
Memory increase: 0.00390625 MB
<built-in function get_interfaces_info> on ens3
0.0 % ... 10.13671875 MB
10.0 % ... 10.13671875 MB
20.0 % ... 10.13671875 MB
30.0 % ... 10.13671875 MB
40.0 % ... 10.13671875 MB
50.0 % ... 10.13671875 MB
60.0 % ... 10.13671875 MB
70.0 % ... 10.13671875 MB
80.0 % ... 10.13671875 MB
90.0 % ... 10.140625 MB
100.0 % ... 10.140625 MB
Memory increase: 0.00390625 MB
<built-in function get_interfaces_info> on bad interface name
0.0 % ... 10.140625 MB
10.0 % ... 10.140625 MB
20.0 % ... 10.140625 MB
30.0 % ... 10.140625 MB
40.0 % ... 10.140625 MB
50.0 % ... 10.140625 MB
60.0 % ... 10.140625 MB
70.0 % ... 10.140625 MB
80.0 % ... 10.140625 MB
90.0 % ... 10.140625 MB
100.0 % ... 10.140625 MB
Memory increase: 0.0 MB
Total memory increase: 0.0078125 MB
- Linguagem predominante
- C
- Estrelas
- 16
- Forks
- 11
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de fedora-python/python-ethtool
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
fedora-python/python-ethtool#61 · 1 comentário ·
-
help wanted
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
fedora-python/python-ethtool#40 · 5 comentários ·
-
Improve tests coverage Abertaenhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
Todas as issues de fedora-python/python-ethtool
Issues semelhantes
-
Broadcast Documentation Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
kovidgoyal/kitty#10516 ·
-
libc
Dificuldade 2/5 1-2 dias Facilidade para iniciantes 76/100
llvm/llvm-project#225506 · 1 comentário ·
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
Status: Waiting triage Type: Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
nanoframework/Home#1857 ·
-
bug
Dificuldade 2/5 Meio dia Facilidade para iniciantes 82/100