mayooear / gpt4-pdf-chatbot-langchain

GPT4 & LangChain Chatbot for large PDF docs
https://www.youtube.com/watch?v=ih9PBGVVOO4
14.76k stars 3k forks source link

FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory #263

Closed pengxichen closed 9 months ago

pengxichen commented 1 year ago

PS C:\gpt4-pdf-chatbot-langchain-main> npm run ingest

gpt4-langchain-pdf-chatbot@0.1.0 ingest tsx -r dotenv/config scripts/ingest-data.ts

[WARN] Importing from 'langchain/document_loaders' is deprecated. Import from eg. 'langchain/document_loaders/fs/text' or 'langchain/document_loaders/web/cheerio' instead. See https://js.langchain.com/docs/getting-started/install#updating-from-0052 for upgrade instructions. split docs [ Document { pageContent: 'ReadDiscussCoursesPracticeVideo\n' + 'An Operating System performs all the basic tasks like managing files, processes, and\n' + 'memory. Thus operating system acts as the manager of all the resources, i.e. resource\n' + 'manager. Thus, the operating system becomes an interface between user and machine. \n' + 'Types of Operating Systems: Some widely used operating systems are as follows- \n' + '1. Batch Operating System –\n' + 'This type of operating system does not interact with the computer directly. There is an\n' + 'operator which takes similar jobs having the same requirement and group them into\n' + 'batches. It is the responsibility of the operator to sort jobs with similar needs. \n' + 'Advantages of Batch Operating System:\n' + 'It is very difficult to guess or know the time required for any job to complete.\n' + 'Processors of the batch systems know how long the job would be when it is in queue\n' + 'Multiple users can share the batch systems\n' + 'The idle time for the batch system is very less\n' + 'It is easy to manage large work repeatedly in batch systems', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'Multiple users can share the batch systems\n' + 'The idle time for the batch system is very less\n' + 'It is easy to manage large work repeatedly in batch systems\n' + 'Disadvantages of Batch Operating System:\n' + 'Types of Operating Systems\n' + 'akash1295\n' + 'Trending NowDSAData StructuresAlgorithmsInterview PreparationData ScienceTopic-wise Practice', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'The computer operators should be well known with batch systems\n' + 'Batch systems are hard to debug\n' + 'It is sometimes costly\n' + 'The other jobs will have to wait for an unknown time if any job fails\n' + 'Examples of Batch based Operating System: Payroll System, Bank Statements, etc. \n' + '2. Time-Sharing Operating Systems –\n' + 'Each task is given some time to execute so that all the tasks work smoothly. Each user\n' + 'gets the time of CPU as they use a single system. These systems are also known as\n' + 'Multitasking Systems. The task can be from a single user or different users also. The time\n' + 'that each task gets to execute is called quantum. After this time interval is over OS\n' + 'switches over to the next task. \n' + 'Advantages of Time-Sharing OS: \n' + 'Each task gets an equal opportunity\n' + 'Fewer chances of duplication of software\n' + 'CPU idle time can be reduced\n' + 'Resource Sharing: Time-sharing systems allow multiple users to share hardware\n' + 'resources such as the CPU, memory, and peripherals, reducing the cost of hardware\n' + 'and increasing efficiency.', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'Resource Sharing: Time-sharing systems allow multiple users to share hardware\n' + 'resources such as the CPU, memory, and peripherals, reducing the cost of hardware\n' + 'and increasing efficiency.\n' + 'Improved Productivity: Time-sharing allows users to work concurrently, thereby\n' + 'reducing the waiting time for their turn to use the computer. This increased productivity\n' + 'translates to more work getting done in less time.\n' + 'Improved User Experience: Time-sharing provides an interactive environment that\n' + 'allows users to communicate with the computer in real-time, providing a better user\n' + 'experience than batch processing.\n' + 'Disadvantages of Time-Sharing OS:', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'Reliability problem\n' + 'One must have to take care of the security and integrity of user programs and data\n' + 'Data communication problem\n' + 'High Overhead: Time-sharing systems have a higher overhead than other operating\n' + 'systems due to the need for scheduling, context switching, and other overheads that\n' + 'come with supporting multiple users.\n' + 'Complexity: Time-sharing systems are complex and require advanced software to\n' + 'manage multiple users simultaneously. This complexity increases the chance of bugs\n' + 'and errors.\n' + 'Security Risks: With multiple users sharing resources, the risk of security breaches\n' + 'increases. Time-sharing systems require careful management of user access,\n' + 'authentication, and authorization to ensure the security of data and software.\n' + 'Examples of Time-Sharing OSs are: Multics, Unix, etc. \n' + 'Examples of Time-Sharing OS with explanation:\n' + 'IBM VM/CMS: IBM VM/CMS is a time-sharing operating system that was first\n' + 'introduced in 1972. It is still in use today, providing a virtual machine environment that', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'IBM VM/CMS: IBM VM/CMS is a time-sharing operating system that was first\n' + 'introduced in 1972. It is still in use today, providing a virtual machine environment that\n' + 'allows multiple users to run their own instances of operating systems and applications.\n' + 'TSO (Time Sharing Option): TSO is a time-sharing operating system that was first\n' + 'introduced in the 1960s by IBM for the IBM System/360 mainframe computer. It\n' + 'allowed multiple users to access the same computer simultaneously, running their own\n' + 'applications.\n' + 'Windows Terminal Services: Windows Terminal Services is a time-sharing operating\n' + 'system that allows multiple users to access a Windows server remotely. Users can run\n' + 'their own applications and access shared resources, such as printers and network\n' + 'storage, in real-time.\n' + '3. Distributed Operating System –\n' + 'These types of the operating system is a recent advancement in the world of computer\n' + 'technology and are being widely accepted all over the world and, that too, with a great', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'These types of the operating system is a recent advancement in the world of computer\n' + 'technology and are being widely accepted all over the world and, that too, with a great\n' + 'pace. Various autonomous interconnected computers communicate with each other using\n' + 'a shared communication network. Independent systems possess their own memory unit\n' + 'and CPU. These are referred to as loosely coupled systems or distributed systems. These\n' + 'system’s processors differ in size and function. The major benefit of working with these\n' + 'types of the operating system is that it is always possible that one user can access the\n' + 'files or software which are not actually present on his system but some other system\n' + 'connected within this network i.e., remote access is enabled within the devices connected', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'in that network. \n' + 'Advantages of Distributed Operating System:\n' + 'Failure of one will not affect the other network communication, as all systems are\n' + 'independent from each other\n' + 'Electronic mail increases the data exchange speed\n' + 'Since resources are being shared, computation is highly fast and durable\n' + 'Load on host computer reduces\n' + 'These systems are easily scalable as many systems can be easily added to the network\n' + 'Delay in data processing reduces\n' + 'Disadvantages of Distributed Operating System:\n' + 'Failure of the main network will stop the entire communication\n' + 'To establish distributed systems the language which is used are not well defined yet\n' + 'These types of systems are not readily available as they are very expensive. Not only\n' + 'that the underlying software is highly complex and not understood well yet\n' + 'Examples of Distributed Operating System are- LOCUS, etc. \n' + '4. Network Operating System –\n' + 'These systems run on a server and provide the capability to manage data, users, groups,', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'Examples of Distributed Operating System are- LOCUS, etc. \n' + '4. Network Operating System –\n' + 'These systems run on a server and provide the capability to manage data, users, groups,\n' + 'security, applications, and other networking functions. These types of operating systems\n' + 'allow shared access of files, printers, security, applications, and other networking\n' + 'functions over a small private network. One more important aspect of Network Operating\n' + 'Systems is that all the users are well aware of the underlying configuration, of all other\n' + 'users within the network, their individual connections, etc. and that’s why these\n' + 'computers are popularly known as tightly coupled systems.', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'Advantages of Network Operating System:\n' + 'Highly stable centralized servers\n' + 'Security concerns are handled through servers\n' + 'New technologies and hardware up-gradation are easily integrated into the system\n' + 'Server access is possible remotely from different locations and types of systems\n' + 'Disadvantages of Network Operating System:\n' + 'Servers are costly\n' + 'User has to depend on a central location for most operations\n' + 'Maintenance and updates are required regularly\n' + 'Examples of Network Operating System are: Microsoft Windows Server 2003, Microsoft\n' + 'Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD, etc. \n' + '5. Real-Time Operating System –\n' + 'These types of OSs serve real-time systems. The time interval required to process and\n' + 'respond to inputs is very small. This time interval is called response time. \n' + 'Real-time systems are used when there are time requirements that are very strict like\n' + 'missile systems, air traffic control systems, robots, etc. \n' + 'Two types of Real-Time Operating System which are as follows:', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'missile systems, air traffic control systems, robots, etc. \n' + 'Two types of Real-Time Operating System which are as follows:\n' + 'Hard Real-Time Systems:\n' + 'These OSs are meant for applications where time constraints are very strict and even\n' + 'the shortest possible delay is not acceptable. These systems are built for saving life\n' + 'like automatic parachutes or airbags which are required to be readily available in case\n' + 'of any accident. Virtual memory is rarely found in these systems.', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'Soft Real-Time Systems:\n' + 'These OSs are for applications where time-constraint is less strict.\n' + 'Advantages of RTOS:\n' + 'Maximum Consumption: Maximum utilization of devices and system, thus more output\n' + 'from all the resources\n' + 'Task Shifting: The time assigned for shifting tasks in these systems are very less. For\n' + 'example, in older systems, it takes about 10 microseconds in shifting one task to\n' + 'another, and in the latest systems, it takes 3 microseconds.\n' + 'Focus on Application: Focus on running applications and less importance to\n' + 'applications which are in the queue.\n' + 'Real-time operating system in the embedded system: Since the size of programs are\n' + 'small, RTOS can also be used in embedded systems like in transport and others.\n' + 'Error Free: These types of systems are error-free.\n' + 'Memory Allocation: Memory allocation is best managed in these types of systems.\n' + 'Disadvantages of RTOS:\n' + 'Limited Tasks: Very few tasks run at the same time and their concentration is very less\n' + 'on few applications to avoid errors.', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'Disadvantages of RTOS:\n' + 'Limited Tasks: Very few tasks run at the same time and their concentration is very less\n' + 'on few applications to avoid errors.\n' + 'Use heavy system resources: Sometimes the system resources are not so good and\n' + 'they are expensive as well.\n' + 'Complex Algorithms: The algorithms are very complex and difficult for the designer to\n' + 'write on.\n' + 'Device driver and interrupt signals: It needs specific device drivers and interrupts\n' + 'signals to respond earliest to interrupts.\n' + 'Thread Priority: It is not good to set thread priority as these systems are very less\n' + 'prone to switching tasks.', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } }, Document { pageContent: 'Similar Reads\n' + '1.Operating Systems | Input Output Systems | Question 5\n' + '2.Operating Systems | Set 1\n' + '3.Operating Systems | Set 2\n' + '4.Operating Systems | Set 3\n' + '5.Operating Systems | Set 4\n' + '6.Operating Systems | Set 5\n' + '7.Operating Systems | Set 6\n' + '8.Operating Systems | Set 10\n' + '9.Operating Systems | Set 7\n' + '10.Operating Systems | Set 8\n' + 'Examples of Real-Time Operating Systems are: Scientific experiments, medical imaging\n' + 'systems, industrial control systems, weapon systems, robots, air traffic control systems,\n' + 'etc.\n' + 'Last Updated : 29 Mar, 2023\n' + '682\n' + 'PreviousNext\n' + 'Article Contributed By :\n' + 'Vote for dif\x00culty\n' + 'Current dif\x00culty : Easy\n' + 'akash1295\n' + '@akash1295\n' + 'EasyNormalMediumHardExpert', metadata: { source: 'C:\gpt4-pdf-chatbot-langchain-main\docs\Types of Operating Systems - GeeksforGeeks.pdf', pdf_numpages: 7, loc: [Object] } } ] creating vector store...

#

Fatal process OOM in Re-embedded builtins: set permissions

#

<--- Last few GCs --->

[3184:0000013D9B9A4250] 156 ms: Mark-Compact 10.3 (14.4) -> 6.3 (18.4) MB, 2.25 / 0.01 ms (+ 1.8 ms in 20 steps since start of marking, biggest step 0.3 ms, walltime since start of marking 4 ms) (average mu = 1.000, current mu = 1.000) finalize incr[3184:0000013D9B9A4250] 8315 ms: Mark-Compact (reduce) 6.8 (18.4) -> 6.4 (8.4) MB, 49.39 / 0.01 ms (+ 1.2 ms in 17 steps since start of marking, biggest step 0.1 ms, walltime since start of marking 51 ms) (average mu = 0.994, current mu = 0.994) fina

<--- JS stacktrace --->

<--- Last few GCs --->

[3184:0000013DB1466820] 33 ms: Scavenge 4.8 (6.1) -> 4.4 (6.6) MB, 0.53 / 0.00 ms (average mu = 1.000, current mu = 1.000) allocation failure; [3184:0000013DB1466820] 50 ms: Scavenge 5.9 (7.4) -> 5.7 (9.9) MB, 0.82 / 0.01 ms (average mu = 1.000, current mu = 1.000) allocation failure; [3184:0000013DB1466820] 122 ms: Scavenge 9.4 (11.9) -> 8.6 (12.1) MB, 24.98 / 0.00 ms (average mu = 1.000, current mu = 1.000) allocation failure;

<--- JS stacktrace --->

FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory FATAL ERROR: NewSpace::EnsureCurrentCapacity Allocation failed - JavaScript heap out of memory

How to solve the ERROR Please give me some guidance

dosubot[bot] commented 9 months ago

Hi, @pengxichen! I'm Dosu, and I'm helping the gpt4-pdf-chatbot-langchain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you opened this issue regarding a fatal error related to a JavaScript heap out of memory. Unfortunately, there hasn't been any activity or comments on the issue since you opened it, and it remains unresolved.

If this issue is still relevant to the latest version of the gpt4-pdf-chatbot-langchain repository, please let the team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your understanding and contribution to the project! Let us know if you have any further questions or concerns.