Skip to content

Paltalk Timer

Viewing 15 posts - 121 through 135 (of 143 total)
  • Author
    Posts
  • #186017
    cyberpunk
    Member

    Removing the S from the MEM_RELEASE Const did allow it to return a 1

    #186016
    Chike
    Member

    @ManicMike wrote:

    Removing the S from the MEM_RELEASE Const did allow it to return a 1

    You talked too soon….
    I said 3 lines.

    #186015
    cyberpunk
    Member

    LOL!

    Then I must be dreaming because I have now commented out my DECOMMIT and using the MEM_RELEASE statement and it is returning a 1 on the first one and a 487 on the second one

    I went ahead and commented out the other DECOMMIT statements and re-enable MEM_RELEASE on on four of my subs and when running the program it is much better but still using more memory than what it was with the DECOMMIT. Which means I have been convinced DECOMMIT is better and think i get why too. Damn shame I had to take the long route to get here. but I couldn’t afford the Bus ticket

    #186014
    Chike
    Member

    You’re brain is a realy good subject for a study.
    Is it that complicated to run those 3 lines as I posted them and see what you get for each one of them?
    No more, no less, no commenting out anything, no adding anything anywhere else, just those 3 lines.
    I am trying to make a conclusion here.

    #186013
    cyberpunk
    Member

    Dude, I did that three or four posts ago

    #186012
    Chike
    Member

    @ManicMike wrote:

    Dude, I did that three or four posts ago

    You mean this?
    @ManicMike wrote:

    Removing the S from the MEM_RELEASE Const did allow it to return a 1

    #186011
    cyberpunk
    Member

    @Chike wrote:

    @ManicMike wrote:

    Dude, I did that three or four posts ago

    You mean this?
    @ManicMike wrote:

    Removing the S from the MEM_RELEASE Const did allow it to return a 1

    This:

        'deallocate the memory and close the process handle
    '**************************************************
    (1) result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_DECOMMIT)
    (0) result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
    If result = 0 Then
    (87) result = Marshal.GetLastWin32Error
    'result = GetLastError()
    End If
    (0) result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
    If result = 0 Then
    (87) result = Marshal.GetLastWin32Error
    'result = GetLastError()
    End If
    #186010
    cyberpunk
    Member

    FYI Adding the S back brings back the error 87’s

    ANd I am only removing the S from the MEM_RELEASE Const

    #186009
    Chike
    Member

    I thought we put the S behind us already.
    These are results with S though.

    #186008
    cyberpunk
    Member

    @Chike wrote:

    I thought we put the S behind us already.
    These are results with S though.

    Betcha $100.00 lol
    Seriously dude, That is the fix, I have full control of the issue i can recreate it at will have twice now.

    The error 87’s ONLY come WITH the S in the MEM_RELEASE Const
    i get no error at all without the S

    Do I get that A+ now?

    Cool we have two solutions, but dude seriously I could not have done it without your help. I really had no idea how to troubleshoot once using a breakpoint, i got it now, still lacking a boatload of experience though.

    The memory usage is better, I see more memory releases..the baseline is 4K memory set change deltas with a lot of 4K releases that I did not have…proof again of MEM-RELEASE functioning w/o the S

    But MEM_DECOMMIT is my choice I think, I like the idea of having the memory reserved for my LVITEM

    #186007
    Chike
    Member

    @ManicMike wrote:

    @Chike wrote:

    I thought we put the S behind us already.
    These are results with S though.

    Betcha $100.00 lol
    Seriously dude, That is the fix, I have full control of the issue i can recreate it at will have twice now.

    The error 87’s ONLY come WITH the S in the MEM_RELEASE Const
    i get no error at all without the S

    Do I get that A+ now?

    Yes the fix is removing the S, and no you’re not getting A+, actually i was thinking to denote you to A- for partial answers.

    @ManicMike wrote:

    Cool we have two solutions, but dude seriously I could not have done it without your help. I really had no idea how to troubleshoot once using a breakpoint, i got it now, still lacking a boatload of experience though.

    No there is only one solution, now you understand why I need full answers and making a solid conclusion?
    What are the results for those lines without the S?

    #186006
    cyberpunk
    Member

    lol good thing we didn’t shake on that bet then, huh?

    I will look at exactly what that S is doing and it helps that I have a nice overview from your earlier posts.
    But you had mentioned that the S should not have been there. the S is after all the other MEM_* statements, and they seem to work just fine.

    Chike, I appreciate your patience in dragging this out. I hope I did not make it too tedious lol

    #186005
    cyberpunk
    Member

    Without the S in MEM_RELEASE

     '**************************************************
    (1) result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_DECOMMIT)
    (1) result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
    If result = 0 Then
    () result = Marshal.GetLastWin32Error
    'result = GetLastError()
    End If
    (0) result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
    If result = 0 Then
    (487) result = Marshal.GetLastWin32Error
    'result = GetLastError()
    End If

    With S in MEM_RELEASE

    **************************************************
    (1) result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_DECOMMIT)
    (0) result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
    If result = 0 Then
    (87) result = Marshal.GetLastWin32Error
    'result = GetLastError()
    End If
    (0) result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
    If result = 0 Then
    (87) result = Marshal.GetLastWin32Error
    'result = GetLastError()
    End If

    Ergo, 😀

    When the S is used I cannot use MEM_RELEASE at all but I CAN use MEM_DECOMMIT
    Without the S I can use either MEM_RELEASE or MEM_DECOMMIT, but I think MEM_DECOMMIT is the better choice.

    #186004
    Chike
    Member

    So what can we learn from this.
    First the most obviouse, is that the S va’se some bad value for MEM_RELEASE, as of the whys I’ve mentioned it aroud Departurs post sp I won’t repear it again.

    BTW did I mention you can view values as hexdecimal in the debugger? Sorry if I didn’t, you can right click the value that pop up when you hover with the mouse over the variable, or in local varivles and select the hexdecimal view.

    And the second conclusion is that you can call VirtualFreeEx with MEM_RELEASE after calling it with MEM_DECOMMIT but not after MEM_RELEASE.

    You could also try calling MEM_DECOMMIT after MEM_RE:EASE and see you get the same result/

    What does that mean? It means the pointer is still valid after decommit, but is invalid after it is releaced, hence your problem cannot be solved by using decommit. It may last longer because no physical pages are commited but the address space is reserved.

    “Decommits the specified region of committed pages. After the operation, the pages are in the reserved state.”

    #186003
    cyberpunk
    Member

    Ah! Very well explained. I totally get what you trying to show me and there is no way I would have figured that out on my own which is why a good foundation is important and I will always lack that. I wish I could go to school for it but for now my foundation is dirt and I swear they got it from a cow pasture lol

    Thanks for all the time and for laying things out in an easy to follow manner Chike. I did learn a great deal not only about how to debug, and thanks for the hex tip, i did not know that, but I also have learned more about this memory hooking process works, clearly i have a lot to learn but now with my newly discovered debug tools I can play around. For now I really want to get my features coded, and then work on getting some of the data attached to an SQL server. it started out as just wanting to query admin lists and some of the other filters i have set up for room text on a per room basis, and a database would mean one table and an assortment of queries to get the lists for each room. Plus I want to use active filter that only runs the filters on users that are in the room. But I also want to archive room logs. Not consistently, but I want it dumping to a database and then i will decide if there was anything worth saving. But I also want to track mic events as well for statistical reasons and well mainly just cuz I can lol

    The entire project was always intended as more than just getting a much needed mic timer but to also be more fun than the “Hello World” projects.The next feature will be remote control of the program from room text and I already have ideas on that. Then I hope to start that Fantasy Football app, but that will be a massive undertaking, this is more my speed for now. And as noted I have plenty of features left to implement. Thanks again Chike for everything.

    So, it is just a relief to have this issue off my plate.

Viewing 15 posts - 121 through 135 (of 143 total)
  • You must be logged in to reply to this topic.