admin管理员组

文章数量:1126103

While running my program in Visual Studio, I observed that memory usage was excessively high (over 40GB). I then used Visual Studio's memory profiler to investigate the issue.

After capturing memory snapshots at two intervals, I observed that two entries std::list<SSD_Components::NVM_Transaction*,std::allocator<SSD_Components::NVM_Transaction*>> and void continue to grow. The differences in both their memory size and count between snapshots are the largest, and they keep increasing, which is unusual since these entries should not be growing indefinitely.

Here’s the relevant code for the User_Request class, which contains the Transaction_list member holding pointers to NVM_Transaction objects. This list is related to the growing entries in the memory profiler for std::list<SSD_Components::NVM_Transaction*,std::allocator<SSD_Components::NVM_Transaction*>>.

class User_Request
{
public:
    User_Request();
    ~User_Request();

    IO_Flow_Priority_Class::Priority Priority_class;
    io_request_id_type ID;
    uint64_t ID_num;
    LHA_type Start_LBA;

    sim_time_type STAT_InitiationTime;
    sim_time_type STAT_ResponseTime;

    std::list<NVM_Transaction*> Transaction_list;

    unsigned int Sectors_serviced_from_cache;

    unsigned int Size_in_byte;
    unsigned int SizeInSectors;
    UserRequestType Type;
    stream_id_type Stream_id;
    bool ToBeIgnored;
    void* IO_command_info;
    void* Data;

private:
    static unsigned int lastId;
};

I’ve checked for potential memory leaks, but I didn’t find any issues. What could be the other possible reasons for the continuous growth in memory usage?

Any insights or suggestions would be greatly appreciated!

本文标签: