-
Notifications
You must be signed in to change notification settings - Fork 65
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
Get MemoryError when rendering multiple file #117
Comments
Darn, that could be a tough one. It could be an issue with any of the VSTs, or it could be a DawDreamer issue. I'll revisit the relevant code when I get a chance. In the meantime, I hope you aren't blocked by this. You could possibly split the midi list into multiple BIG parts (each one taking ~30 min) and execute each part with python's subprocess. |
Further test shown as follows: After rendering total 4226 seconds of audio, program exited with error 0xC0000409 when (loading preset of) Ample Guitar L. I will update latest test result here. Hope it's helpful. |
Thanks, then it seems like a problem with DawDreamer. |
I don't have a full solution yet. Here's a script I was using. I was looking at the Task Manager in Windows and watching the memory usage for a Windows Command Prompt slowly rise. I was noticing the peak value go up by 0.1 MB every 15 seconds or so. It varies per plugin. import dawdreamer as daw
plugin_path = "C:/VSTPlugins/Serum_x64.dll"
class Player:
def render(self):
engine = daw.RenderEngine(44100, 128)
plugin = engine.make_plugin_processor("plugin", plugin_path)
# # eventually want to make sure these don't leak either
# plugin.add_midi_note(60, 60, 0.0, .25)
# plugin.add_midi_note(64, 80, 0.5, .5)
# plugin.add_midi_note(67, 127, 0.75, .5)
# engine.load_graph([(plugin, []),])
# engine.render(.01)
# return engine.get_audio()
player = Player()
i = 0
while True:
player.render()
if i % 100 == 0:
print('i', i//100)
i += 1 The issue must be related to the Plugin Processor specifically because replacing the plugin creation line with
results in no leak. The Sampler Processor has a lot in common with the Plugin Processor such as midi buffers, and yet it doesn't leak in the setup above. import numpy as np
plugin = engine.make_sampler_processor("plugin", np.zeros((2,128))) I haven't figured out what's wrong with the plugin processor class... I tried If anyone is running a large render batch with DawDreamer, I'd recommend writing your code so that plugins aren't repeatedly created and deleted. Create an engine, create the plugins you need, and reload the graphs as necessary however many times you want. I don't think that style of code is leaking. |
My code structure is:
When I run this code, it will run normally first. After an hour or two, It will get a
MemoryError: bad allocation
.I wonder how can I avoid this.
My computer have 24GB memory, and usually have 14GB available for my code.
The text was updated successfully, but these errors were encountered: