Skip to content

[v4] - Strapi can't handle many records. #12004

@rserafim

Description

@rserafim

Bug report

Describe the bug

Error accessing a record in admin.

Strapi can't handle working with too many records. I only have 1 million and he is crying. I still need to go up another 5 million.

This error only happens when I click on a record that is related to a city that has hundreds of companies.

If I click on a record, in which the city has dozens of companies, the error doesn't happen.

That's because it's running on localhost.

Steps to reproduce the behavior

  1. Go to /content-manager/collection-types
  2. Click on any register
  3. See error

INFO REGISTER COMPANY ID = 1314737

total companies same city = 235611
total companies same category = 272

Expected behavior

Show the data like the example below.

INFO REGISTER COMPANY ID = 2
total companies same city = 1
total companies same category = 2
image

Screenshots

INFO REGISTER COMPANY ID = 1314737
image
image

Searching via Graphql the result comes correctly.
image

Code snippets

[2021-12-22 21:10:46.340] error: select distinct "t0".*, "t1"."company_id" from "categories" as "t0" left join "companies_category_links" as "t1" on "t0"."id" = "t1"."category_id" where ("t1"."company_id" in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, ....)) - bind message has 39003 parameter formats but 0 parameters at Parser.parseErrorMessage (/Volumes/SSD Externo/_PROJETOS/XXX/XXX/api-portalfull-v2/node_modules/pg-protocol/dist/parser.js:287:98) at Parser.handlePacket (/Volumes/SSD Externo/_PROJETOS/XXX/XXX/api-portalfull-v2/node_modules/pg-protocol/dist/parser.js:126:29) at Parser.parse (/Volumes/SSD Externo/_PROJETOS/XXX/XXX/api-portalfull-v2/node_modules/pg-protocol/dist/parser.js:39:38) at Socket.<anonymous> (/Volumes/SSD Externo/_PROJETOS/XXX/XXX/api-portalfull-v2/node_modules/pg-protocol/dist/index.js:11:42) at Socket.emit (events.js:315:20) at Socket.EventEmitter.emit (domain.js:467:12) at addChunk (internal/streams/readable.js:309:12) at readableAddChunk (internal/streams/readable.js:284:9) at Socket.Readable.push (internal/streams/readable.js:223:10) at TCP.onStreamRead (internal/stream_base_commons.js:188:23)

And if it keeps trying to show the registration data (blank screen print), some time later this error will appear.
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

System

  • Node.js version: v14.16.0
  • YARN version: 1.22.17
  • Strapi version: v4
  • Database: DOCKER/POSTGRES
  • Operating system: macos

Content-Type COMPANY

image
image

DATA INFOS

total companies = 1.229.134
total cities = 10.186
total categories = 2.351

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugIssue reporting a bugseverity: highIf it breaks the basic use of the productsource: core:databaseSource is core/database packagestatus: confirmedConfirmed by a Strapi Team member or multiple community members

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions