New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slowdown and high memory usage when adding a new module in embedded Python 3.4 on 64bit Windows #65309
Comments
The example in the "Extending Embedded Python" (https://docs.python.org/3/extending/embedding.html#extending-embedded-python) takes up a lot of memory and slow downs the computer. I am using Windows 7 64bit, Python 3.4 64bit and gcc (rubenvb-4.8.0) 4.8.0. Solution: Apparently, you need to add this to your C program: #define HAVE_SSIZE_T I found the solution at (https://forums.embarcadero.com/message.jspa?messageID=581594). The page said that when adding the above, "this ensures that the type Py_ssize_t becomes __int64 instead of int." Expected: The programmer should not see a simple program (that came from the main documentation, no less) causing slowdowns and high memory usage. The 64bit version of the Python installer was downloaded so the programmer should, at least, not need to know that they need this flag. Can the Python.h in the 64 bit builds automatically set the flag? Or, if this isn't feasible, add a note to the documentation that this flag exist. |
Who is best placed to address this issue? |
Is this issue still alive? |
Steve: Are you aware of this issue? "Apparently, you need to add this to your C program: #define HAVE_SSIZE_T" |
Never heard of it, but perhaps there are some preprocessor checks for Windows that assume you are using MSVC and not gcc? We don't support compilers other than MSVC on Windows, but if someone has a fix for this I'm happy to consider it. |
Original issue report doesn't make sense to me. |
In case of doubt, I suggest to close the issue. If the issue strikes back, |
Its a shame the link is now gone. Its also been a long time that I don't remember all the details. I still have my code from back when I found this bug. I can try to replicate it.
I don't remember why I used rubenvb back then. I'll see if I can get MSVC working. Maybe this is the cause for the slow down. |
I couldn't replicate since my old dev machine didn't have rubenvb. Since this issue has been around for 5 years already, rubenvb isn't maintained and I couldn't replicate, I think its fine to close this issue. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: