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

cli-kintone requires huge amount memories #102

Open
ueokande opened this issue Sep 30, 2022 · 1 comment
Open

cli-kintone requires huge amount memories #102

ueokande opened this issue Sep 30, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ueokande
Copy link
Member

Why

cli-kintone allocates a huge amount of memory when processing a lot of records. I tested importing CSV with 10,000 records. I measured memory usage of cli-kintone on macOS by the time command. As a result, cli-kintone requires over 500MiB memories. The memory usage size may be depends on number of records and each row size.

$ /usr/bin/time -l cli-kintone record import --app 12345 --file-path 10000_records.csv --update-key UUID
[2022-09-30T00:37:08.163Z] INFO: Preparing to import records...
[2022-09-30T00:37:22.321Z] INFO: Starting to import records...
[2022-09-30T00:37:48.261Z] INFO: Imported 2000 of 10000 records
[2022-09-30T00:38:23.053Z] INFO: Imported 4000 of 10000 records
[2022-09-30T00:38:50.967Z] INFO: Imported 6000 of 10000 records
[2022-09-30T00:39:17.246Z] INFO: Imported 8000 of 10000 records
[2022-09-30T00:39:47.250Z] INFO: Imported 10000 of 10000 records
[2022-09-30T00:39:47.250Z] INFO: Imported 10000 records successfully
      162.60 real         4.14 user         0.80 sys
           561577984  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
              238914  page reclaims
                   0  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
               21327  messages sent
                1042  messages received
                   0  signals received
                  59  voluntary context switches
               57377  involuntary context switches
         38562478220  instructions retired
         19344958618  cycles elapsed
           375767040  peak memory footprint

What

Decrease memory usage; it independents on the number of records.

@ueokande ueokande added the enhancement New feature or request label Sep 30, 2022
@tasshi-me
Copy link
Member

tasshi-me commented Oct 13, 2022

After fixing kintone/js-sdk#1745 and kintone/js-sdk#1746,
we can use Stream to import/export attachments.

It also degreases memory usage.

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

No branches or pull requests

2 participants