Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot allocate memory #864

Closed
1 of 3 tasks
porjo opened this issue Feb 8, 2017 · 1 comment
Closed
1 of 3 tasks

cannot allocate memory #864

porjo opened this issue Feb 8, 2017 · 1 comment
Labels
issue/duplicate The issue has already been reported.

Comments

@porjo
Copy link

porjo commented Feb 8, 2017

  • Gitea version (or commit ref): 1.0.1
  • Git version:1.8.3.1
  • Operating system: Centos7
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite

Description

I'm playing with Gitea on an AWS t2.micro instance (1G RAM) and running into memory issues. I attempted to push a moderate size repo up and it failed like so:

$ git push gitea Dev
Username for 'http://x.x.x.x': porjo
Password for 'http://[email protected]': 
Counting objects: 58543, done.
Compressing objects: 100% (18180/18180), done.
Writing objects: 100% (58543/58543), 133.41 MiB | 37.76 MiB/s, done.
Total 58543 (delta 41293), reused 56418 (delta 39647)
error: RPC failed; result=22, HTTP code = 500
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
$ 

(the repo I was pushing is a total of 384MB on disk (including .git folder).)

Now when I use the Gitea web frontend I keep getting error 500 messages, and the Gitea console log keeps display 'cannot allocate memory' errors. e.g. I attempt to create a new repository via the web frontend, and see this is in the log file:

2017/02/08 03:09:22 [T] action.newRepoAction: porjo/iantest2
2017/02/08 03:09:22 [...routers/repo/repo.go:103 handleCreateError()] [E] CreatePost: initRepository: InitRepository: fork/exec /usr/bin/git: cannot allocate memory
[Macaron] 2017-02-08 03:09:22: Completed /repo/create 500 Internal Server Error in 5.075568ms
2017/02/08 03:09:22 [D] Template: status/500

Top shows Gitea consuming in excess of 400MB!

top - 03:25:49 up 35 min,  2 users,  load average: 0.00, 0.01, 0.05
Tasks: 110 total,   2 running, 108 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1015348 total,   210440 free,   520656 used,   284252 buff/cache
KiB Swap:        0 total,        0 free,        0 used.   330864 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                                                                                                     
 2292 root      20   0  831856 449520  10332 S  0.0 44.3   0:01.19 gitea

I can understand why it might get upset about the initial push, but I would expect it to fail more gracefully. Why would it a) continue to consume so much memory b) not be able to allocate more memory for a simple operation (create repo) when there is still 210MB free!?

I've stopped and started Gitea and it has returned to normal. Attempting to push the same repo again causes the same issue.

@lunny lunny added the issue/duplicate The issue has already been reported. label Feb 8, 2017
@lunny
Copy link
Member

lunny commented Feb 8, 2017

please discuss in #218.

@lunny lunny closed this as completed Feb 8, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/duplicate The issue has already been reported.
Projects
None yet
Development

No branches or pull requests

2 participants