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

Init takes forever #168

Open
jmauro opened this issue Feb 2, 2024 · 4 comments
Open

Init takes forever #168

jmauro opened this issue Feb 2, 2024 · 4 comments

Comments

@jmauro
Copy link

jmauro commented Feb 2, 2024

Hello,

First, I just want to thank you for this tremendous tools!!! ❤️

I am encountering a small issue when trying to initialize the tool with my secret key:

hishtory init "XXXXXXXXXXXXXXXXXXXXXXXX"
Your current hishtory profile has saved history entries, are you sure you want to run `init` and reset?
Note: This won't clear any imported history entries from your existing shell
[y/N]y
Setting secret hishtory key to XXXXXXXXXXXXXXXXXXXX
time="2024-02-02T11:52:39Z" level=info msg="ApiGet(\"/api/v1/register?user_id=XXX=&device_id=XXX\"): 615.651926ms\n"
Killed
$ hishtory status -v
hiSHtory: v0.266
Enabled: true
Secret Key: XXXXXXXXXXXXXXXXXXXXXXXXXX
User ID: XXXXXXXXXXXXXXXXXX
Device ID: XXXXXXXXXXXXXXXXXXX
Sync Mode: Enabled
Sync Status: Synced
Commit Hash: 81ed634a4baa0414639f102a308e21907f68f703

And to be honest, I am unable to provide any logs apart from what is present in this comment. If you need my secrete key to troubleshoot, just drop a PM.

Kind regards,
JM

@jmauro
Copy link
Author

jmauro commented Feb 2, 2024

I found the issue, the process was oom-killed. Sorry for the noise.

BTW, the init could take up to 3Go in memory 😉

@jmauro jmauro closed this as completed Feb 2, 2024
@jmauro jmauro reopened this Feb 2, 2024
@jmauro
Copy link
Author

jmauro commented Feb 2, 2024

Since I was able to debug a bit more, I found out that the init process consumes a lot of memory (At peak time, my init was consuming 4,5 Go):
image

I am not sure if this could be avoided (I might have a lot of history to import).

Kind regards,
JM

@ddworken
Copy link
Owner

ddworken commented Feb 5, 2024

Thank you for opening this issue! You must have quite the large history file--can you share how many lines are in it (i.e. history | wc -l)? I've started to work on optimizing this in #171, but I want to continue to iterate and benchmark this to ensure that it is a solid long term solution.

@jmauro
Copy link
Author

jmauro commented Feb 6, 2024

Thank you for opening this issue! You must have quite the large history file--can you share how many lines are in it (i.e. history | wc -l)? I've started to work on optimizing this in #171, but I want to continue to iterate and benchmark this to ensure that it is a solid long term solution.
Hello,

I am around 5000 entries... Not that big:

ls -al ~/.hishtory/
total 61508
drwxr--r--  2 root root     4096 Feb  6 17:05 .
drwx------ 11 root root     4096 Feb  6 16:03 ..
-rw-r--r--  1 root root      800 Feb  6 17:05 .hishtory.config
-rw-r--r--  1 root root  8183808 Feb  6 17:03 .hishtory.db
-rw-r--r--  1 root root    32768 Feb  6 17:05 .hishtory.db-shm
-rw-r--r--  1 root root  4177712 Feb  6 17:05 .hishtory.db-wal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants