Questions tagged [memory]

To address any concerns regarding memory management or programming issues, utilize this specific tag. For inquiries pertaining to memory hardware problems or general software errors, it is recommended to visit memory. Alternatively, for enterprise-level hardware or software-related matters, refer to memory.

Adding to a JSON file in PHP: A step-by-step guide

My task involves generating JSON files to load into data tables, containing thousands of rows from the database. However, I am facing an issue where I receive a fatal error due to memory exhaustion while trying to allocate space for adding new rows. Fat ...

Error parsing XML with SAX in PHP: memory exhausted at line x

Currently, I am utilizing the SAX Parser along with PHP to parse a 1.2GB XML file and save the results in a text file. However, after a few minutes, I encounter an error stating "no memory at line x". Surprisingly, the resulting text file is only a few kB ...

Restrictions of Vue Data Objects

I'm currently pondering the optimal amount of data to store in a Vue data object. Imagine I have over 4,000 objects structured like this: personWithAppointment = { id: 1, appointment_id: 1, first_name: 'Jim', last_name: 'Jim', // +20 more simila ...

Ensure that the memory usage of each process in Node.js is restricted to under 300MB

We execute tests in different instances and some of our test suites consist of more than 20 files. Is there a way to restrict the memory usage of a Node.js process to less than 300MB instead of allowing it to grow? If we don't set any limits, each process ...

What are some alternative methods for visualizing memory usage in node.js applications?

I've been working on a project that involves running several persistent processes in node.js. As I continue to develop the project, I am interested in monitoring and charting the memory usage of each process over time to aid in debugging. Although this ma ...

Uncovering the Proliferation of Memory Leaks in NodeJS

My ExpressJS Server is set up like this: var express = require("express"), app = express(); app.use(express.static(__dirname)); app.listen(1050); Upon starting the server, it consumes 20MB of v8 heap memory. However, if I reload the page every seco ...

PHP Error: Fatal error - Insufficient memory (allocated 576192512) attempted to allocate 486801418 bytes in "file" at line 410

Here is a snippet of the program that is causing the issue: file_put_contents("icecatcategorydata.xml.gz", $xml); $file = gzopen("icecatcategorydata.xml.gz", "r"); $content = ''; while (($buffer = fgets($file)) !== false) { $content .= $buff ...

Is the variable leaping to a superior scope?

A few days back, I encountered a strange bug in my code that has left me puzzled. It appears that a variable declared within a narrower scope is somehow leaking into a broader one. Any insights into what might be going wrong here? Here's a simplified versi ...

What is the memory allocation for null values in arrays by node.js?

Continuing the discussion from this thread: Do lots of null values in an array pose any harm? I experimented with node.js by doing this: arr=[] arr[1000]=1 arr[1000000000]=2 arr.sort() However, I encountered the following error: FATAL ERROR: JS Alloca ...

Exploring the Power of Functions in Python 3

Within my code, there are four functions that function in the following manner: def function_four(): # Implements logic function_one() def function_three(): # Implements logic function_two() def function_one(): usr_input = input("Op ...

Minimize the memory footprint of this Pandas script when loading a JSON file and saving it as a pickle

I'm having trouble trying to further optimize memory usage for my program. Essentially, I am parsing JSON log files into a pandas dataframe but encountering the following challenges: The append function is causing substantial memory consumption as it cre ...

Memory leakage during the traversal of an object network

Is object graph traversal in doctrine scalable? Take a look at this entity with a graph-like structure (which is guaranteed to be acyclic): /** * @ORM\Entity() */ class Node { //... /** * @ORM\ManyToOne(targetEntity="Node&q ...

How do I control the memory usage of my PHP web application and prevent it from consuming excessive resources?

Launching a PHP web application in the near future that is expected to consume a significant amount of memory. How can I establish a limit to prevent it from exceeding a certain threshold? What would be an appropriate limit? The high memory consumption i ...

Different Memory Allocation Methods Based on lvalue Binding Time in Python

I'm encountering some challenges with a homework assignment. Despite conducting thorough research, I've hit a roadblock. The assignment entails: Create and execute an example showcasing the various variable types that the designated language su ...

Executing multiple jar files in Python using multithreading results in longer execution times

I am currently utilizing ThreadPoolExecutor and assigning identical tasks to workers. The task involves running a jar file and performing certain operations on it, but I have encountered an issue related to timing. Scenario 1: When I submit a single task ...

Using the storage() method in Pytorch, all Tensor storages will share the same id

Currently, I am delving into the realm of tensor storage by exploring a blog written in my mother tongue, Vietnamese. While tinkering with various examples, I stumbled upon a concept that proved to be quite perplexing. Consider three tensors x, zzz, and x_ ...