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

Is there a workaround to compile a big table in 4GB memory device for release version #1038

Closed
yushb0602 opened this issue May 17, 2022 · 9 comments

Comments

@yushb0602
Copy link

I have a table with 18 columns, It works well in debug version with gcc 11.1, C++ 20 standard. but when I switch to release version, get a compiling error:
c++: fatal error: Killed signal terminated program cc1plus.
The 4Gb memory is not enough, When I remove some columns or enlarge into 16GB memory, these cases are workable.

There is a workaround to compile it in 4GB memory hardware ?

    auto log =   make_table("Log1",
        make_column("timestamp", &LogRecord::timestamp),
        make_column("trend", &LogRecord::trend),
        make_column("pen1", &LogRecord::pen1),
        make_column("pen2", &LogRecord::pen2),
        make_column("pen3", &LogRecord::pen3),
        make_column("pen4", &LogRecord::pen4),
        make_column("pen5", &LogRecord::pen5),
        make_column("pen6", &LogRecord::pen6),
        make_column("pen7", &LogRecord::pen7),
        make_column("pen8", &LogRecord::pen8),
        make_column("pen9", &LogRecord::pen9),
        make_column("pen10", &LogRecord::pen10),
        make_column("pen11", &LogRecord::pen11)
        /*make_column("pen12", &LogRecord::pen12)
        make_column("pen13", &LogRecord::pen13),
        make_column("pen14", &LogRecord::pen14),
        make_column("pen15", &LogRecord::pen15),
        make_column("pen16", &LogRecord::pen16)
        */
    );

 
    auto storage = make_storage("ogic3.db", tabAlarm, tabEvent,  log);

    storage.sync_schema();
@trueqbit
Copy link
Collaborator

sqlite_orm is of course very template-heavy.

A few questions:

  • Does this also happen in a sample program or only in a larger context?
  • Are options for multi-processor/parallel compilation in effect?
  • Just to see something - did you check the memory usage during compilation?
  • Which version of sqlite_orm do you use?
  • Could you try the latest dev branch, please?

@fnc12
Copy link
Owner

fnc12 commented May 21, 2022

@yushb0602 are you there?

1 similar comment
@fnc12
Copy link
Owner

fnc12 commented May 22, 2022

@yushb0602 are you there?

@yushb0602
Copy link
Author

Good news, I have tried the latest dev branch. This issue doesn't exist anymore.

This exists in the latest in main branch v1.7.1. The memory grows gradually to more than 16Gb when I monitor by top command. only make it with make -j1

@yushb0602
Copy link
Author

Furthmore, It takes me about seconds compile for dev branch version, but about 3 mins for the v1.71 main branch.
Thanks for big improvement!

@fnc12
Copy link
Owner

fnc12 commented May 24, 2022

wow it is very nice. Thanks to @trueqbit for his improvement

@fnc12 fnc12 closed this as completed May 24, 2022
@trueqbit
Copy link
Collaborator

@yushb0602 Would be interesting whether things are still the same for you with the branch from PR #1039!

@Zvicii
Copy link

Zvicii commented Dec 1, 2022

@fnc12 I have run into the same problem. Will this be in the next version? And when will it be released?

@fnc12
Copy link
Owner

fnc12 commented Dec 1, 2022

@Zvicii sorry for delay. Much stuff appear in my life. Let me make a release during this week

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

No branches or pull requests

4 participants